Skip to content

Commit dfc2732

Browse files
authored
pythongh-91340: Document multiprocessing.set_start_method force parameter (pythonGH-32339)
python#91340 https://bugs.python.org/issue47184 Automerge-Triggered-By: GH:kumaraditya303
1 parent 969620d commit dfc2732

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Doc/library/multiprocessing.rst

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1089,10 +1089,14 @@ Miscellaneous
10891089
.. versionchanged:: 3.11
10901090
Accepts a :term:`path-like object`.
10911091

1092-
.. function:: set_start_method(method)
1092+
.. function:: set_start_method(method, force=False)
10931093

10941094
Set the method which should be used to start child processes.
1095-
*method* can be ``'fork'``, ``'spawn'`` or ``'forkserver'``.
1095+
The *method* argument can be ``'fork'``, ``'spawn'`` or ``'forkserver'``.
1096+
Raises :exc:`RuntimeError` if the start method has already been set and *force*
1097+
is not ``True``. If *method* is ``None`` and *force* is ``True`` then the start
1098+
method is set to ``None``. If *method* is ``None`` and *force* is ``False``
1099+
then the context is set to the default context.
10961100

10971101
Note that this should be called at most once, and it should be
10981102
protected inside the ``if __name__ == '__main__'`` clause of the

0 commit comments

Comments
 (0)