Posts: 80
Threads: 2
Joined: Feb 2014
Reputation:
2
Location: New York, NY
Haha, I didn't even know you could adjust the number of threads. I figured that was all hardcoded in. Is that the setting under the plugin where it says "extra threads?"
"I know now why you cry... but it is something I can never do."
-Emotion Engine
Posts: 80
Threads: 2
Joined: Feb 2014
Reputation:
2
Location: New York, NY
(04-26-2014, 11:07 PM)avih Wrote: Thanks for your work!
Thanks for the rep. But it is still in its very early stage. Once I am more familiar with the code I plan to add some real documentation.
I am proud of the linux compile guide though. That was my original work
"I know now why you cry... but it is something I can never do."
-Emotion Engine
Posts: 80
Threads: 2
Joined: Feb 2014
Reputation:
2
Location: New York, NY
Just some interesting facts, I looked into the gcc implementation of std::thread, and it does in fact use pthread at its core (I'm not sure there are any other options on a UNIX system anyway). Though I agree that portability and clean code are always desirable!
"I know now why you cry... but it is something I can never do."
-Emotion Engine
Posts: 80
Threads: 2
Joined: Feb 2014
Reputation:
2
Location: New York, NY
Ran into a little snafu today in that to do a std library implementation of IGSEvent, I need access to the mutex that is inside of an IGSLock. I may have to make some ENABLE_STD_THREAD-specific modifications to IGSEvent.
"I know now why you cry... but it is something I can never do."
-Emotion Engine
Posts: 80
Threads: 2
Joined: Feb 2014
Reputation:
2
Location: New York, NY
When debugging with GDB, how do I break at a line in GSThread.h? GDB doesn't seem to recognize that the file exists.
"I know now why you cry... but it is something I can never do."
-Emotion Engine
Posts: 6.069
Threads: 68
Joined: May 2010
Reputation:
167
Location: Grenoble, France
Are you sure you didn't misspell the file. Otherwise try to break first in a function that call those GSThread.h function. Then step into a function.You can add a breakpoint on the current file with this kind of command.
Posts: 80
Threads: 2
Joined: Feb 2014
Reputation:
2
Location: New York, NY
05-12-2014, 10:59 PM
(This post was last modified: 05-12-2014, 11:05 PM by krysto.)
Alright... so I'm still a little perplexed on how to go about a std library implementation of GSEvent. GSEvent relies on plain semaphores, but std library does not give you access to raw semaphores as it was deemed "too much rope for programmers to hang themselves with". Instead you are supposed to make use of only std::thread, std::mutex, and std::condition_variable. In addition, you are required to use std::condition_variable in conjunction with a std::mutex, which makes working with interfaces difficult, GSEvent would need direct access to a member inside the GSCritSec.
TLDR; std::thread is designed to be a high-level library to begin with, so it is difficult to encapsulate.
I could just make a new branch and replace all threading in GSdx with std.
"I know now why you cry... but it is something I can never do."
-Emotion Engine