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

7

4

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.)

Shinrai

Posted 2010-07-23T18:00:42.043

Reputation: 18 051

Does giving this process a higher priority not help? – Phoshi – 2010-07-23T18:08:58.467

It helps, but we're also looking to optimize total system performance if at all possible, and having other things dragging would not be an ideal consequence.

I really suspect this may not be doable at all, but if there's any way to do this...it's worth a shot. – Shinrai – 2010-07-23T18:21:54.477

Did you try to set process's affinity to one core and set priority to realtime? This way other processes wont be able to use that core. Still, it's not a real solution – AndrejaKo – 2010-08-11T16:25:17.083

1That's sort of a shotgun solution, yes...we've found a semblance of a workaround in the sense that our setup is going to be usable for our client, but I'd still love to know if there's some way of doing this. – Shinrai – 2010-08-11T18:42:40.347

+1 Great question. I know it can be done in Linux but I'm not sure about windows. – Evan Plaice – 2011-02-11T00:36:54.993

Answers

3

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.

Riduidel

Posted 2010-07-23T18:00:42.043

Reputation: 1 467

1A bit kludgy but it's an interesting thought. Do you know of any similar tools (commandline or otherwise, although obviously command line is a hella lot easier to script) that work under post-XP/Server2K3 builds of Windows? – Shinrai – 2010-12-29T17:24:49.270