5

I want to run some benchmarks on Windows 7. These benchmarks have to do with hyper-threading on a multi-core CPU. For this, I want to ensure that only the benchmarks are running on their own logical processor. Is there any way to tell Windows to not schedule anything on there certain logical processors, unless I allow it explicitly for a process?

Doing this manually in the task manager, one process at a time, is not an option. I want to be able to do this repeatedly (I will be running many benchmarks many times). I know how to programmatically set the affinity for the current running process.

Is there any configuration that can allow me to set the default affinity for all processes?

3 Answers3

12

Process Lasso supports this! It comes with a free and paid version, CPU affinities is always free...

Just fill in a * in the Name match field, which will target all processes.

I think you can then add your programs to have another affinity, the order in which you enter the rules might matter. Also, you can tick More strictly enforce default affinities at the bottom.

enter image description here

Gareth
  • 19,080
2

If you go into task manager processes and right click on the process you should be able to select the affinity.

enter image description here

To disable a core you can use msconfig. I don't think you can enable it on a per-process basis.

Pubby
  • 364
1
  1. Open your start menu
  2. type msconfig, and hit enter
  3. Go to the tab marked as boot
  4. Highlight the OS of your choice, and hit advanced options.
  5. Check number of processors, and use however many you want.

This causes windows (and everything else) to see and use only the specified number of processors. So it effectively completely disables the rest. It will (and can) never use more than the number of available cores).

enter image description here

Hennes
  • 65,804
  • 7
  • 115
  • 169