Is there a way to reliably detect the total number of CPU cores?

Posted by John Sheares on Stack Overflow See other posts from Stack Overflow or by John Sheares
Published on 2010-04-04T18:36:32Z Indexed on 2010/04/04 18:43 UTC
Read the original article Hit count: 144

Filed under:
|
|
|

I need a reliable way to detect how many CPU cores are on a computer. I am creating a numerically intense simulation C# application and want to create the maximum number of running threads as cores. I have tried many of the methods suggested around the internet like Environment.ProcessorCount, using WMI, this code: http://blogs.adamsoftware.net/Engine/DeterminingthenumberofphysicalCPUsonWindows.aspx. None of them seem to think a AMD X2 has two cores. Any ideas?

© Stack Overflow or respective owner

Related posts about multithreading

Related posts about cpu-cores