News for hackers. Stuff that matters.
Re:Forcing the CPU affinity can make a monothreaded process ... by Jach on Sunday December 09, 2012 @03:37PM (#4896023)
There's an insightful comment by GreenCat in the SetProcessAffinityMask documentation about how doing this in Windows is likely to hurt your performance: http://msdn.microsoft.com/en-us/library/windows/desktop/ms68...

In fact, this seems like a Prisoner's Dilemma problem with the OS having programs cooperate by default. There's a chance you'll speed up your application by locking it to a core (defecting), but only if none of the other applications try the same thing.

Re:Forcing the CPU affinity can make a monothreaded process ... by Symmetry on Sunday December 09, 2012 @03:49PM (#4896075)
Right. Setting the process affinity mask is a fine thing to do - if you're making these decisions for a specific piece of hardware with a specific set of programs running on it. It's madness for the OS or the person writing the software to try to do it for you, though.