Open
Description
Created per offline feedback.
Consider adding something like Environment.TotalProcessorCount. The problem is Environment.ProcessorCount is returning a value designed for scheduling threads within a process. The Windows scheduler has a feature called processor groups that limits one process to at most 64 cores. However, if you’re writing code to schedule processes (instead of threads) then you need accurate machine-wide numbers.
It is currently possible to workaround this behavior by setting following env variables:
set complus_GCCpuGroup=1
set COMPlus_Thread_UseAllCpuGroups=1
but setting environment variables is not ideal as a permanent solution.