➜

This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

作者 giampaolo.rodola
收信人 giampaolo.rodola, paul.moore, pitrou, steve.dower, tim.golden, yanirh, zach.ware
日期 2018-03-28.14:53:12
SpamBayes Score -1.0
Marked as misclassified 是
Message-id <1522248792.99.0.467229070634.issue33166@psf.upfronthosting.co.za>
In-reply-to
内容
By re-reading
https://bugs.python.org/issue30581 and
https://github.com/giampaolo/psutil/issues/771#issuecomment-264457333 I now remember why I haven't fixed this issue in psutil yet: because the whole thing (MS APIs and doc basically) is confusing.

GetMaximumProcessorCount (now used by os.cpu_count()) returns "the maximum number of logical processors that a processor group or the system CAN have", not the actual number. That would explain why in OP's case os.cpu_count() returns 128 instead of 40.

As per https://bugs.python.org/issue30581#msg295255 dwNumberOfProcessors wasn't good because it doesn't take multiple processor groups into account (hence the number may be too small) and GetLogicalProcessorInformationEx may be the way to go. This is based on the assumption that os.cpu_count() should report the number of CPUs in the system (including the non-usable ones, like in case of process groups).
历史
日期 用户 动作 参数
2018-03-28 14:53:13giampaolo.rodola修改recipients: + giampaolo.rodola, paul.moore, pitrou, tim.golden, zach.ware, steve.dower, yanirh
2018-03-28 14:53:12giampaolo.rodola修改messageid: <1522248792.99.0.467229070634.issue33166@psf.upfronthosting.co.za>
2018-03-28 14:53:12giampaolo.rodola链接issue33166 messages
2018-03-28 14:53:12giampaolo.rodola创建