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

Giampaolo Rodola' report at bugs.python.org
Wed Mar 28 09:09:05 EDT 2018


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

The difference between os.cpu_count() and psutil.cpu_count() is because one uses GetMaximumProcessorCount() and the other dwNumberOfProcessors.

This is tracked as a bug in psutil bug tracker but it's not fixed yet:
https://github.com/giampaolo/psutil/issues/771

As for Python this is where it was discussed and changed:
https://bugs.python.org/issue30581
https://github.com/python/cpython/commit/c67bae04780f9d7590f9f91b4ee5f31c5d75b3c3

In summary: psutil is wrong and you should rely on os.cpu_count().

----------

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


More information about the Python-bugs-list mailing list