mirror of
https://github.com/python/cpython
synced 2026-09-29 09:40:29 +03:00
Issue #17914: Add os.cpu_count(). Patch by Yogesh Chaudhari, based on an
initial patch by Trent Nelson.
This commit is contained in:
parent
93c6770c72
commit
44feda3cd0
6 changed files with 95 additions and 27 deletions
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue