mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
gh-91340: Document multiprocessing.set_start_method force parameter (GH-32339)
#91340 https://bugs.python.org/issue47184 Automerge-Triggered-By: GH:kumaraditya303
This commit is contained in:
parent
969620d59a
commit
dfc2732a57
1 changed files with 6 additions and 2 deletions
|
@ -1089,10 +1089,14 @@ Miscellaneous
|
|||
.. versionchanged:: 3.11
|
||||
Accepts a :term:`path-like object`.
|
||||
|
||||
.. function:: set_start_method(method)
|
||||
.. function:: set_start_method(method, force=False)
|
||||
|
||||
Set the method which should be used to start child processes.
|
||||
*method* can be ``'fork'``, ``'spawn'`` or ``'forkserver'``.
|
||||
The *method* argument can be ``'fork'``, ``'spawn'`` or ``'forkserver'``.
|
||||
Raises :exc:`RuntimeError` if the start method has already been set and *force*
|
||||
is not ``True``. If *method* is ``None`` and *force* is ``True`` then the start
|
||||
method is set to ``None``. If *method* is ``None`` and *force* is ``False``
|
||||
then the context is set to the default context.
|
||||
|
||||
Note that this should be called at most once, and it should be
|
||||
protected inside the ``if __name__ == '__main__'`` clause of the
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue