[issue33166] os.cpu_count() returns wrong number of processors on specific systems

Giampaolo Rodola' report at bugs.python.org
Wed Mar 28 17:04:21 EDT 2018


Giampaolo Rodola' <g.rodola at gmail.com> added the comment:

I created a psutil branch using GetLogicalProcessorInformation() to determine both logical and physical CPUs:
https://github.com/giampaolo/psutil/pull/1257
According to https://stackoverflow.com/questions/31209256 basically all Windows APIs are unreliable and GetLogicalProcessorInformationEx() is what should really be used. 
That is available only starting from Windows 7 though so apparently what we want is GetLogicalProcessorInformationEx() and if not available fallback on GetActiveProcessorCount(ALL_PROCESSOR_GROUPS) which may still report the wrong number of CPUs on 32 bit processes.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33166>
_______________________________________


More information about the Python-bugs-list mailing list