I know how to get the number of physical, and number of logical processors on my machine, but I want to know how many logical processors my application has access to.
For instance, I develop on a quad core machine, but I have a number of single core users out there, and in many instances I "dumb down" the interface, or run into locking problems that a multi-core system never experiences.
So, to that end I have set up VSTS to build my app in either debug or "Debug Single Core". The goal there is basically to set the processor affinity to core "0", which by looking at the windows task manager is working as expected.
My problem is, I just noticed, ( and hind sight says it should have been obvious ), that throughout my code I have Environment.ProcessorCount >= something
, which works great for truly single core machines, but doesn't give me a read on my single "logically available core".
How can I get the number of "available" logical cores?
C# preferred