VOGONS


Reply 20 of 27, by artelius

User metadata
Rank Newbie
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.

Reply 21 of 27, by Reckless

User metadata
Rank Oldbie
Rank
Oldbie
franpa wrote:

Well, I am after a way to make it so that single threaded programs run on a single thread. I do not wish to use the affinity setting.

Any reason why you don't want to set CPU affinity?

Reply 22 of 27, by gulikoza

User metadata
Rank Oldbie
Rank
Oldbie

Well, Intel CPUs have shared L2 cache, so when program switches cores it can pull all the data from L2 (which might have to do anyway even if it stayed on the same core, depends on what ran in between) if it's lucky. On AMD CPU, it would have to pull all the data from system memory again. I'm not sure how that interconnect bridge is supposed to work, but somehow I don't imagine one core giving instructions to the other one - give me all the data from thread xxxx you have in your cache, I'm running it now 😜. But then again, we'd see a massive improvement in Phenom cores (with shared L3 cache) if this was the case.

http://www.si-gamer.net/gulikoza

Reply 23 of 27, by franpa

User metadata
Rank Oldbie
Rank
Oldbie

Yes, I did some reading up on this and it appears that some of the single threaded programs i use are optimised for co-threading where the program runs on one thread, the video renderer on another, the sound engine on another etc. and with co-threading only one thing can occur at anytime so the task is split up (sliced).

http://byuu.cinnamonpirate.com/programming/libco/
This is a excellent article on it that makes it very easy to understand.

AMD Ryzen 3700X | ASUS Crosshair Hero VIII (WiFi) | 16GB DDR4 3600MHz RAM | MSI Geforce 1070Ti 8GB | Windows 10 Pro x64.

my website

Reply 24 of 27, by franpa

User metadata
Rank Oldbie
Rank
Oldbie
gulikoza wrote:

Can I make windows see only 1 core? Check your bios or change Computer to ACPI Uniprocessor PC. But I wouldn't recommend that, it is better to set the affinity.

I tried setting it to a Standard PC and er... I DON'T think i'll be doing that again any time soon 😜 the Alcohol 120% virtual drive fucked itself and windows could not assign hardware resources to it and manually doing that makes windows blue screen on boot up 😜 oh and the device was locked so i couldnt use alcohol's uninstall program to remove it and doing it via Device Manager will result in windows reinstalling it upon reboot >.>.

I got my pc back via doing a windows repair installation and pressing F5 as soon as the cd was booted from (keep tapping it) then scrolling up in the list and choosing ACPI MultiProcessor PC which is hidden since the list only shows 2 options at a time and it starts at the bottom of the list.

What is ACPI Uniprocessor? could you provide some info on it?

AMD Ryzen 3700X | ASUS Crosshair Hero VIII (WiFi) | 16GB DDR4 3600MHz RAM | MSI Geforce 1070Ti 8GB | Windows 10 Pro x64.

my website

Reply 26 of 27, by artelius

User metadata
Rank Newbie
Rank
Newbie
gulikoza wrote:

Well, Intel CPUs have shared L2 cache, so when program switches cores it can pull all the data from L2 (which might have to do anyway even if it stayed on the same core, depends on what ran in between) if it's lucky. On AMD CPU, it would have to pull all the data from system memory again. I'm not sure how that interconnect bridge is supposed to work, but somehow I don't imagine one core giving instructions to the other one - give me all the data from thread xxxx you have in your cache, I'm running it now 😜. But then again, we'd see a massive improvement in Phenom cores (with shared L3 cache) if this was the case.

Cache! Of course. I forgot. Silly me.

So let me revise what I said before: A good scheduler will try to stop moving a thread between cores too often (in moderation it is a good thing, to spread the load evenly).

There is still nothing wrong with a single program that contains more than one thread having different threads on different cores.

Reply 27 of 27, by franpa

User metadata
Rank Oldbie
Rank
Oldbie

I gave ACPI Uniprocessor a try and windows set it back to ACPI Multiprocessor >.> it did however change this setting http://i63.photobucket.com/albums/h133/franpa … untitled-11.png

changing that setting is much easier then changing that computer type... changing the computer type requires doing a windows repair in some cases >.>

EDIT: Uniprocessor mode is multiprocessor mode but it locks that variable in the picture. you can switch back to 'normal' mode via device manager.

AMD Ryzen 3700X | ASUS Crosshair Hero VIII (WiFi) | 16GB DDR4 3600MHz RAM | MSI Geforce 1070Ti 8GB | Windows 10 Pro x64.

my website