[issue30581] os.cpu_count() returns wrong number of processors on system with > 64 logical processors

STINNER Victor report at bugs.python.org
Tue Jun 6 08:53:23 EDT 2017


STINNER Victor added the comment:

On Windows, os.cpu_count() is currently implemented with:

"GetSystemInfo(&sysinfo); return sysinfo.dwNumberOfProcessors;"

https://msdn.microsoft.com/en-us/library/windows/desktop/ms724958(v=vs.85).aspx

It seems to return the number of *logical* CPUs:

"""
dwNumberOfProcessors

    The number of logical processors in the current group.

Note: For information about the physical processors shared by logical processors, call GetLogicalProcessorInformationEx with the RelationshipType parameter set to RelationProcessorPackage (3).
"""

It seems like you have two physical CPU packages. Maybe the function only returns infos from the first package?

----------
nosy: +haypo

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue30581>
_______________________________________


More information about the Python-bugs-list mailing list