diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2012-08-04 14:16:35 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2012-08-04 14:16:35 (GMT) |
commit | 848698727fcbb633246b56ab57080b4d5493c186 (patch) | |
tree | af5543aa381427085e745fc5c139c94ea15b94ee /Doc | |
parent | a0e3febe5ae4b01f2076d1f0f09b76f366611a16 (diff) | |
download | cpython-848698727fcbb633246b56ab57080b4d5493c186.zip cpython-848698727fcbb633246b56ab57080b4d5493c186.tar.gz cpython-848698727fcbb633246b56ab57080b4d5493c186.tar.bz2 |
Issue #12655: Instead of requiring a custom type, os.sched_getaffinity and
os.sched_setaffinity now use regular sets of integers to represent the
CPUs a process is restricted to.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/os.rst | 42 |
1 files changed, 6 insertions, 36 deletions
diff --git a/Doc/library/os.rst b/Doc/library/os.rst index 48b1521..59ff3eb 100644 --- a/Doc/library/os.rst +++ b/Doc/library/os.rst @@ -3141,47 +3141,17 @@ operating system. Voluntarily relinquish the CPU. -.. class:: cpu_set(ncpus) - - :class:`cpu_set` represents a set of CPUs on which a process is eligible to - run. *ncpus* is the number of CPUs the set should describe. Methods on - :class:`cpu_set` allow CPUs to be add or removed. - - :class:`cpu_set` supports the AND, OR, and XOR bitwise operations. For - example, given two cpu_sets, ``one`` and ``two``, ``one | two`` returns a - :class:`cpu_set` containing the cpus enabled both in ``one`` and ``two``. - - .. method:: set(i) - - Enable CPU *i*. - - .. method:: clear(i) - - Remove CPU *i*. - - .. method:: isset(i) - - Return ``True`` if CPU *i* is enabled in the set. - - .. method:: count() - - Return the number of enabled CPUs in the set. - - .. method:: zero() - - Clear the set completely. - - .. function:: sched_setaffinity(pid, mask) - Restrict the process with PID *pid* to a set of CPUs. *mask* is a - :class:`cpu_set` instance. + Restrict the process with PID *pid* (or the current process if zero) to a + set of CPUs. *mask* is an iterable of integers representing the set of + CPUs to which the process should be restricted. -.. function:: sched_getaffinity(pid, size) +.. function:: sched_getaffinity(pid) - Return the :class:`cpu_set` the process with PID *pid* is restricted to. The - result will contain *size* CPUs. + Return the set of CPUs the process with PID *pid* (or the current process + if zero) is restricted to. .. _os-path: |