Issue #17914: Add os.cpu_count(). Patch by Yogesh Chaudhari, based on an

initial patch by Trent Nelson.
This commit is contained in:
Charles-Francois Natali 2013-05-20 14:40:46 +02:00
parent 93c6770c72
commit 44feda3cd0
6 changed files with 95 additions and 27 deletions

View file

@ -702,6 +702,9 @@ Miscellaneous
Return the number of CPUs in the system. May raise
:exc:`NotImplementedError`.
.. seealso::
:func:`os.cpu_count`
.. function:: current_process()
Return the :class:`Process` object corresponding to the current process.

View file

@ -3155,10 +3155,6 @@ operating system.
Return the set of CPUs the process with PID *pid* (or the current process
if zero) is restricted to.
.. seealso::
:func:`multiprocessing.cpu_count` returns the number of CPUs in the
system.
.. _os-path:
@ -3196,6 +3192,13 @@ Miscellaneous System Information
Availability: Unix.
.. function:: cpu_count()
Return the number of CPUs in the system. Returns None if undetermined.
.. versionadded:: 3.4
.. function:: getloadavg()
Return the number of processes in the system run queue averaged over the last