diff options
author | Thomas Moreau <thomas.moreau.2010@gmail.com> | 2017-10-03 09:53:17 (GMT) |
---|---|---|
committer | Antoine Pitrou <pitrou@free.fr> | 2017-10-03 09:53:17 (GMT) |
commit | e8c368df22c344183627e7ef882bea1683fe6dbe (patch) | |
tree | 3023a6313e5eab67c87cf1ccfb3e13e8c524ea77 /Doc/library | |
parent | efb560eee28b6b2418e1231573ca62574d6dc07b (diff) | |
download | cpython-e8c368df22c344183627e7ef882bea1683fe6dbe.zip cpython-e8c368df22c344183627e7ef882bea1683fe6dbe.tar.gz cpython-e8c368df22c344183627e7ef882bea1683fe6dbe.tar.bz2 |
bpo-31540: Allow passing multiprocessing context to ProcessPoolExecutor (#3682)
Diffstat (limited to 'Doc/library')
-rw-r--r-- | Doc/library/concurrent.futures.rst | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Doc/library/concurrent.futures.rst b/Doc/library/concurrent.futures.rst index d85576b..30556fb 100644 --- a/Doc/library/concurrent.futures.rst +++ b/Doc/library/concurrent.futures.rst @@ -191,13 +191,16 @@ that :class:`ProcessPoolExecutor` will not work in the interactive interpreter. Calling :class:`Executor` or :class:`Future` methods from a callable submitted to a :class:`ProcessPoolExecutor` will result in deadlock. -.. class:: ProcessPoolExecutor(max_workers=None) +.. class:: ProcessPoolExecutor(max_workers=None, mp_context=None) An :class:`Executor` subclass that executes calls asynchronously using a pool of at most *max_workers* processes. If *max_workers* is ``None`` or not given, it will default to the number of processors on the machine. If *max_workers* is lower or equal to ``0``, then a :exc:`ValueError` will be raised. + *mp_context* can be a multiprocessing context or None. It will be used to + launch the workers. If *mp_context* is ``None`` or not given, the default + multiprocessing context is used. .. versionchanged:: 3.3 When one of the worker processes terminates abruptly, a @@ -205,6 +208,10 @@ to a :class:`ProcessPoolExecutor` will result in deadlock. was undefined but operations on the executor or its futures would often freeze or deadlock. + .. versionchanged:: 3.7 + The *mp_context* argument was added to allow users to control the + start_method for worker processes created by the pool. + .. _processpoolexecutor-example: |