Reply 20 of 27, by artelius
- Rank
- Newbie
DOSBOX uses SDL and SDL internally uses threads:
http://www.libsdl.org/faq.php?action=listentr … s&category=2#12
AFAIK, 99% of the time, running two different threads on separate cores (as opposed to running one at a time on a single core) will increase performance.
i believe if a program is split into 2 threads and the 2 threads need too communicate with each other to stay in sync, you would take a performance hit everytime that occurred right?
When they are running on separate cores, they can communicate instantly! If they are restricted to one core, then their communication is staggered because only one of them can run at once.
Also, when a thread's timeslice is over, or it calls a blocking function, it "switches out" so that another program may run. This is a context switch, and is a little costly. Later on, the thread will "switch in" again so it can resume running.
I don't think it makes much difference - if any - whether it switches to the same core it was running on before, or to another one. Such context switches will happen anyway, so unless the OS has a poorly-designed scheduler, there shouldn't be a problem.
Still, this is all theoretical deduction. There may be factors I haven't considered, and as I have suggested, if Windows' scheduler sucks then maybe you will experience unnecessary problems.