[gameprogrammer] Re: Threads and processor affinity

  • From: Brian Barrett <brian.ripoff@xxxxxxxxx>
  • To: gameprogrammer@xxxxxxxxxxxxx
  • Date: Sun, 1 May 2011 18:02:01 +0100

A good OS will move processor hungry threads onto idle cores. If it
does not, then maybe manually managing the affinity is a solution. A
note though: manually managing affinity can be a bad solution, what if
all programs did this! They would probably all end up on the first few
cores, with any others lying idle. Unless you see evidence of a
particular OS mismanaging allocation, I would be hesitant to mess
around with affinity.

On consoles I imagine it is much more useful, my understanding is that
console operating systems are simpler and you aren't competing with
other processes for the available cores.

On 30 April 2011 18:42, Alan Wolfe <alan.wolfe@xxxxxxxxx> wrote:
> Hey Guys,
>
> I've seen/read in multiple places that people recommend creating at
> max one thread per core of the machine to keep the context switching
> overhead (and such) from degrading performance.
>
> I was wondering, when you do that, does it automatically try and put
> each thread on it's own core or do you have to force processor
> affinity per thread to make that happen?
>
> I'm most curious about windows PCs but if OS matters, does linux / BSD
> behave differently?  How about on the 360 or PS3 (excluding the SPUs
> hehe)?
>
> Thanks!
>

---------------------
To unsubscribe go to http://gameprogrammer.com/mailinglist.html


Other related posts: