I am curious as to what the .NET property Environment.ProcessorCount
actually returns. Does it return the number of cores, the number of processors or both? If my computer had 2 processors, each with 4 cores, would Environment.ProcessorCount
return 2, 4, or 8?
views:
241answers:
4
A:
If my computer had 2 processors, each with 4 cores, would Environment.ProcessorCount return 2, 4, or 8?
It returns 8, in my case anyways. (Core i7 860 cpu).
leppie
2009-11-22 20:17:15
+4
A:
It will return the NUMBER_OF_PROCESSORS environment variable. (see MSDN)
This will equal the number of logical cores - i.e. if you have a HT enabled single core processor, it will return 2.
In your case, it should return 8.
It will be the same number as the number of CPU utilization graphs you will see in task manager.
Marek
2009-11-22 20:18:17
+2
A:
The accepted answer to this SO question has all the correct, detailed information.
Alex Martelli
2009-11-22 20:18:25