Tim Peters added the comment:

Devin, a primary point of `threading.py` is to provide a sane alternative to 
the cross-platform thread mess.  None of these reports are about making it 
easier for threads to go away "by magic" when the process ends.  It's the 
contrary:  they're asking for multiprocessing to respect threading.py's default 
behavior of making it the programmer's responsibility to shut down their 
threads cleanly.  "Shut down your threads, or we refuse to let the process end."

It doesn't matter that native OS threads may behave differently.  threading.py 
very deliberately makes _its_ thread abstraction "non-daemonic" by default, and 
advertises that behavior for all platforms.  So it's at best surprising that 
threading.Thread's default semantics get turned inside out when multiprocessing 
creates a process.  I still see no reason to believe that's "a feature".

As to docs, if it boils down to the difference between `sys.exit()` and 
`os._exit()`, then _those_ are the places to put details, and multiprocessing 
docs just need to point out when a created process will use one or the other.

As is, the docs don't contain the slightest clue anywhere that a 
threading.Thread may violate its own docs (with respect to process-exit 
behavior) when created by a process launched by multiprocessing (or also by a 
concurrent.futures.ProcessPoolExecutor?  I didn't check).

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue18966>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to