Windows – Setting CPU cores off-limits to all threads not specified (preferably in Windows 7)

cpuwindows 7

I have a really specific machine configuration in the works that would really be helped out if there were any way to do this…basically what I'm looking for is the opposite of setting CPU Affinity for a process. I want to be able to tell Windows "No applications except [x] are allowed on [these cores]."

Is there any mechanism whatsoever for doing this? (Yes, I am aware of some of the potential issues this could cause and I normally would never fool with processor affinities, since the OS usually does a damned good job itself, but this is a pretty odd situation involving some software that is very CPU-bound constantly having to wait on interrupts and DPCs and things from other threads.)

Best Answer

Well, talking about shotgun solutions, I think you should go the script way using, as an example Command Line Process Viewer/Killer/Suspender for Windows NT/2000/XP and write a script (any language accepted) that would take all active processes (excepeted the one of your choice) and set their affinity to any other processor than the chosen one. However, as it is only an affinity, I can't ensure you that your processor will be left alone for your preferred program.

Personnally, i consider the optimal solution to your problem is to set both affinity and priority.