Setting CPU cores off-limits to all threads not specified (preferably in Windows 7)
2014-07
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.)
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.
I got me a nice new laptop and I want to know a bit more about the hardware.
How can I see how many CPUs my computer has in Windows 7?
(Note: Clicking on Start->Right clicking on Computer-> selecting properties shows me the processor type, but does not say anything about the core count.
Do a Ctrl + Shift + Esc. This will open the Windows Task Manager. Once you are here, go to Performance. Now you should see many boxes in the CPU Usage History section which will identify how many cores you have. This will include hyper threaded cores also.
-Hope this helps.
You don't need other programs. Just run this in the command prompt:
WMIC CPU Get DeviceID,NumberOfCores,NumberOfLogicalProcessors
and you will get a list of Cores/Logical Processors for each CPU on your machine
Or if you're lazy, just type
WMIC CPU Get /Format:List
and look for entries with the names NumberOfCores
and NumberOfLogicalProcessors
.
Check your TaskManager, You can look under the performance tab and count the number of cores. If your processor has HyperThreadingTechnology (HTT) then half of the cores are logical and not physical.
On a shell type:
echo %NUMBER_OF_PROCESSORS%
Not necessarily as advanced on the others, but the all CPU meter is one of the few useful things I've used in terms of widgets on windows 7. It's a pretty good tool for keeping track of how much CPU power is being used. It will also display how many cores your computer has and is fairly unobtrusive.
you can also tell by going to device manager, and then going to the processor section, it'll display a little thingamajig (I forgot what they're called :/) for each core, but I'm not sure if it can tell the difference between cores and virtual cores.