File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -102,7 +102,7 @@ to start a process. These *start methods* are
102102 will not be inherited. Starting a process using this method is
103103 rather slow compared to using *fork * or *forkserver *.
104104
105- Available on Unix and Windows. The default on Windows.
105+ Available on Unix and Windows. The default on Windows and macOS .
106106
107107 *fork *
108108 The parent process uses :func: `os.fork ` to fork the Python
@@ -124,6 +124,11 @@ to start a process. These *start methods* are
124124 Available on Unix platforms which support passing file descriptors
125125 over Unix pipes.
126126
127+ .. versionchanged :: 3.8
128+
129+ On macOS, *spawn * start method is now the default: *fork * start method is no
130+ longer reliable on macOS, see :issue: `33725 `.
131+
127132.. versionchanged :: 3.4
128133 *spawn * added on all unix platforms, and *forkserver * added for
129134 some unix platforms.
Original file line number Diff line number Diff line change @@ -469,6 +469,16 @@ access the ``madvise()`` system call.
469469(Contributed by Zackery Spytz in :issue: `32941 `.)
470470
471471
472+ multiprocessing
473+ ---------------
474+
475+ Added new :mod: `multiprocessing.shared_memory ` module.
476+ (Contributed Davin Potts in :issue: `35813 `.)
477+
478+ On macOS, the *spawn * start method is now used by default.
479+ (Contributed by Victor Stinner in :issue: `33725 `.)
480+
481+
472482os
473483--
474484
Original file line number Diff line number Diff line change @@ -309,7 +309,12 @@ def _check_available(self):
309309 'spawn' : SpawnContext (),
310310 'forkserver' : ForkServerContext (),
311311 }
312- _default_context = DefaultContext (_concrete_contexts ['fork' ])
312+ if sys .platform == 'darwin' :
313+ # bpo-33725: running arbitrary code after fork() is no longer reliable
314+ # on macOS since macOS 10.14 (Mojave). Use spawn by default instead.
315+ _default_context = DefaultContext (_concrete_contexts ['spawn' ])
316+ else :
317+ _default_context = DefaultContext (_concrete_contexts ['fork' ])
313318
314319else :
315320
Original file line number Diff line number Diff line change 1+ On macOS, the :mod: `multiprocessing ` module now uses *spawn * start method by
2+ default.
You can’t perform that action at this time.
0 commit comments