will not be inherited. Starting a process using this method is
rather slow compared to using *fork* or *forkserver*.
- Available on Unix and Windows. The default on Windows.
+ Available on Unix and Windows. The default on Windows and macOS.
*fork*
The parent process uses :func:`os.fork` to fork the Python
Available on Unix platforms which support passing file descriptors
over Unix pipes.
+.. versionchanged:: 3.8
+
+ On macOS, *spawn* start method is now the default: *fork* start method is no
+ longer reliable on macOS, see :issue:`33725`.
+
.. versionchanged:: 3.4
*spawn* added on all unix platforms, and *forkserver* added for
some unix platforms.
(Contributed by Zackery Spytz in :issue:`32941`.)
+multiprocessing
+---------------
+
+Added new :mod:`multiprocessing.shared_memory` module.
+(Contributed Davin Potts in :issue:`35813`.)
+
+On macOS, the *spawn* start method is now used by default.
+(Contributed by Victor Stinner in :issue:`33725`.)
+
+
os
--
'spawn': SpawnContext(),
'forkserver': ForkServerContext(),
}
- _default_context = DefaultContext(_concrete_contexts['fork'])
+ if sys.platform == 'darwin':
+ # bpo-33725: running arbitrary code after fork() is no longer reliable
+ # on macOS since macOS 10.14 (Mojave). Use spawn by default instead.
+ _default_context = DefaultContext(_concrete_contexts['spawn'])
+ else:
+ _default_context = DefaultContext(_concrete_contexts['fork'])
else:
--- /dev/null
+On macOS, the :mod:`multiprocessing` module now uses *spawn* start method by
+default.