summaryrefslogtreecommitdiffstats
path: root/Doc/library/concurrent.futures.rst
diff options
context:
space:
mode:
authorGregory P. Smith <greg@krypto.org>2022-05-06 07:04:53 (GMT)
committerGitHub <noreply@github.com>2022-05-06 07:04:53 (GMT)
commitfa4f0a134e7911b2494ea9866c8a49ff446f9d6c (patch)
tree4890fee63ed702f2b7d05f554d56c8757f6c0c4e /Doc/library/concurrent.futures.rst
parent2b563f1ad31af0bb0a9947e6f1f76e58dbf170f0 (diff)
downloadcpython-fa4f0a134e7911b2494ea9866c8a49ff446f9d6c.zip
cpython-fa4f0a134e7911b2494ea9866c8a49ff446f9d6c.tar.gz
cpython-fa4f0a134e7911b2494ea9866c8a49ff446f9d6c.tar.bz2
gh-90622: Prevent max_tasks_per_child use with a fork mp_context. (#91587)
Prevent `max_tasks_per_child` use with a "fork" mp_context to avoid deadlocks. Also defaults to "spawn" when no mp_context is supplied for safe convenience.
Diffstat (limited to 'Doc/library/concurrent.futures.rst')
-rw-r--r--Doc/library/concurrent.futures.rst7
1 files changed, 5 insertions, 2 deletions
diff --git a/Doc/library/concurrent.futures.rst b/Doc/library/concurrent.futures.rst
index 9592808..99703ff 100644
--- a/Doc/library/concurrent.futures.rst
+++ b/Doc/library/concurrent.futures.rst
@@ -254,8 +254,11 @@ to a :class:`ProcessPoolExecutor` will result in deadlock.
*max_tasks_per_child* is an optional argument that specifies the maximum
number of tasks a single process can execute before it will exit and be
- replaced with a fresh worker process. The default *max_tasks_per_child* is
- ``None`` which means worker processes will live as long as the pool.
+ replaced with a fresh worker process. By default *max_tasks_per_child* is
+ ``None`` which means worker processes will live as long as the pool. When
+ a max is specified, the "spawn" multiprocessing start method will be used by
+ default in absense of a *mp_context* parameter. This feature is incompatible
+ with the "fork" start method.
.. versionchanged:: 3.3
When one of the worker processes terminates abruptly, a