diff options
author | Nick Coghlan <ncoghlan@gmail.com> | 2013-12-17 12:17:26 (GMT) |
---|---|---|
committer | Nick Coghlan <ncoghlan@gmail.com> | 2013-12-17 12:17:26 (GMT) |
commit | 9a76735b1dd427f4b7d6712ca3bb2b8958e689e8 (patch) | |
tree | cf7c4136675644172eb366d5ee6468b399c9880c /Doc | |
parent | 7cff4cd7e9f45cc4d2a1ee469c133b09e9ed7633 (diff) | |
download | cpython-9a76735b1dd427f4b7d6712ca3bb2b8958e689e8.zip cpython-9a76735b1dd427f4b7d6712ca3bb2b8958e689e8.tar.gz cpython-9a76735b1dd427f4b7d6712ca3bb2b8958e689e8.tar.bz2 |
Close #19946: use runpy as needed in multiprocessing
- handles main files without a suffix
- handles main submodules properly
- adds test cases for the various kinds of __main__
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/whatsnew/3.4.rst | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/Doc/whatsnew/3.4.rst b/Doc/whatsnew/3.4.rst index 4cbc1e4..5a4fa86 100644 --- a/Doc/whatsnew/3.4.rst +++ b/Doc/whatsnew/3.4.rst @@ -624,13 +624,22 @@ mmap objects can now be weakref'ed. multiprocessing --------------- -On Unix two new *start methods* have been added for starting processes -using :mod:`multiprocessing`. These make the mixing of processes with -threads more robust. See :issue:`8713`. +On Unix, two new *start methods* (``spawn`` and ``forkserver``) have been +added for starting processes using :mod:`multiprocessing`. These make +the mixing of processes with threads more robust, and the ``spawn`` +method matches the semantics that multiprocessing has always used on +Windows. (Contributed by Richard Oudkerk in :issue:`8713`). Also, except when using the old *fork* start method, child processes will no longer inherit unneeded handles/file descriptors from their parents. +:mod:`multiprocessing` now relies on :mod:`runpy` (which implements the +``-m`` switch) to initialise ``__main__`` appropriately in child processes +when using the ``spawn`` or ``forkserver`` start methods. This resolves some +edge cases where combining multiprocessing, the ``-m`` command line switch +and explicit relative imports could cause obscure failures in child +processes. (Contributed by Nick Coghlan in :issue:`19946`) + os -- |