Have you tried ProcessThread.ProcessorAffinity ? ProcessorAffinity represents each processor as a bit . Bit 0 represents processor one, bit 1 represents second processor, and so on. For instance:
var currectProcess = System.Diagnostics.Process.GetCurrentProcess(); foreach(System.Diagnostics.ProcessThread thread in currectProcess.Threads) {
Now I have the following configuration on NCrunch, which looks very similar to the previous C # example:
- NCrunch-assigned processor cores: 0, 1, 2
- Processor Cores assigned by Visual Studio: 3
But the only author of NCrunch @ remco-mulder could tell us if this is true or not.
btw: ReSharper has similar options for controlling the number of parallel running unittests threads.
source share