Sign in to follow this  
Adaline

Windows : distribution of running threads on CPU cores

Recommended Posts

Adaline    710
Hello

Is Windows (Vista and 7) able to automatically change the executing core of running threads for a better distribution of the running threads on the CPU ?

Thank you

Share this post


Link to post
Share on other sites
SimonForsman    7642
Yes, in fact it is often forced to do so since you'll have far more threads running than cores to execute them on. (Which means most threads will be inactive and the OS has to swap between them rapidly to keep up the appearance of multiple applications running at the same time, each time a thread is swapped in it will be placed on the core best suited for it)

Share this post


Link to post
Share on other sites
You will do yourself and your users a great favour if you forget about thread affinity (and even more so about process affinity) right away.

There are very, very, very few valid reasons why one would need to set thread affinity and 99% of the time when people do this, it only shows that they're totally clueless. It is utterly annoying for users having to reset affinity every time after starting your program, too.

Don't do it, everything is good as it is.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this