[issue23530] os and multiprocessing.cpu_count do not respect cpuset/affinity

Charles-François Natali report at bugs.python.org
Fri Feb 27 21:08:49 CET 2015


Charles-François Natali added the comment:

Well, we already expose CPU affinity:

>>> import os
>>> os.sched_getaffinity(0)
{0}

IMO the current implementation is sufficient (and talking about
overcommitting for CPU is a bit moot if you're using virtual machine
anyways).

The current documentation says:
   Return the number of CPUs in the system. Returns None if undetermined.

Which to me is clear enough, although if you want to add an explicit
note that this doesn't take cpu affinity into account that wouldn't
hurt.

----------

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


More information about the Python-bugs-list mailing list