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

后端 未结 4 1678
北海茫月
北海茫月 2021-01-18 05:57

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

4条回答
  •  轮回少年
    2021-01-18 06:27

    You are getting the correct processor count, AMD X2 is a true multi-core processor. An Intel hyperthreaded core is treated by Windows as a muti-core CPU. You can find out whether or not hyperthreading is used with WMI, Win32_Processor, NumberOfCores vs NumberOfLogicalProcessors.

提交回复
热议问题