Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Complete the doc
  • Loading branch information
vstinner committed Oct 1, 2023
commit 6059deec8634e1ecb9675fb12e5ba95b348155a2
6 changes: 5 additions & 1 deletion Doc/library/concurrent.futures.rst
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ And::
ThreadPoolExecutor now reuses idle worker threads before starting
*max_workers* worker threads too.

.. versionchanged:: 3.8
.. versionchanged:: 3.13
Default value of *max_workers* is changed to
``min(32, (os.process_cpu_count() or 1) + 4)``.

Expand Down Expand Up @@ -305,6 +305,10 @@ to a :class:`ProcessPoolExecutor` will result in deadlock.
different start method. See the :func:`os.fork` documentation for
further explanation.

.. versionchanged:: 3.13
*max_workers* uses :func:`os.process_cpu_count` by default, instead of
:func:`os.cpu_count`.

.. _processpoolexecutor-example:

ProcessPoolExecutor Example
Expand Down
4 changes: 4 additions & 0 deletions Doc/library/multiprocessing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2249,6 +2249,10 @@ with the :class:`Pool` class.
.. versionadded:: 3.4
*context*

.. versionchanged:: 3.13
*processes* uses :func:`os.process_cpu_count` by default, instead of
:func:`os.cpu_count`.

.. note::

Worker processes within a :class:`Pool` typically live for the complete
Expand Down
3 changes: 2 additions & 1 deletion Doc/whatsnew/3.13.rst
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ Other Language Changes

* :mod:`multiprocessing`, :mod:`concurrent.futures`, :mod:`compileall`:
Replace :func:`os.cpu_count` with :func:`os.process_cpu_count` to select the
default number of worker threads and processes.
default number of worker threads and processes. Get the CPU affinity
if supported.
(Contributed by Victor Stinner in :gh:`109649`.)


Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
:mod:`multiprocessing`, :mod:`concurrent.futures`, :mod:`compileall`:
Replace :func:`os.cpu_count` with :func:`os.process_cpu_count` to select the
default number of worker threads and processes. Patch by Victor Stinner.
default number of worker threads and processes. Get the CPU affinity if
supported. Patch by Victor Stinner.