Total number of CPU cores
Posted: Fri Jun 14, 2024 11:06 pm
Is there a way to obtain information indicating the same total number of CPU cores that the Windows O/S reports and is also reported by other software I'm using?
For the PureBasic function CountCPUs() the documentation indicates that it returns "the total number of CPU cores installed in the computer", but it only shows me the result "2" whereas Windows shows me "2" cores x "2" logical processors — please see image below.
Another software that I happen to use, indicates the machine has 4 cores, the same as Windows reports :

I see that CountCPUs() has a further 'type' of #PB_System_ProcessCPUs, showing the number of cores available to the process, which is also 2. I don't think this is the relevant value.
A thread on the forum, shows alternative code to establish the number of cores, presumably pre-dating the CountCPUs() function, but this also returns only a value of "2" — https://www.purebasic.fr/english/viewtopic.php?t=42544
For the PureBasic function CountCPUs() the documentation indicates that it returns "the total number of CPU cores installed in the computer", but it only shows me the result "2" whereas Windows shows me "2" cores x "2" logical processors — please see image below.
Code: Select all
Debug CountCPUs(#PB_System_CPUs); * Returns 2
I see that CountCPUs() has a further 'type' of #PB_System_ProcessCPUs, showing the number of cores available to the process, which is also 2. I don't think this is the relevant value.
A thread on the forum, shows alternative code to establish the number of cores, presumably pre-dating the CountCPUs() function, but this also returns only a value of "2" — https://www.purebasic.fr/english/viewtopic.php?t=42544