diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2013-02-15 20:31:33 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2013-02-15 20:31:33 (GMT) |
commit | db0b7be566f9442f8d09548b4ae1e4d475e09fc0 (patch) | |
tree | 5ee1941fb1668e8b8652668391dca232b1e13fc0 /Doc/library/threading.rst | |
parent | 23e043fdcd52c2bdcde40b07f21e56ab8a956cff (diff) | |
parent | 38b82543f7f38d7e23586e6773e0e114d335f22d (diff) | |
download | cpython-db0b7be566f9442f8d09548b4ae1e4d475e09fc0.zip cpython-db0b7be566f9442f8d09548b4ae1e4d475e09fc0.tar.gz cpython-db0b7be566f9442f8d09548b4ae1e4d475e09fc0.tar.bz2 |
Issue #17208: add a note about the termination behaviour of daemon threads.
Diffstat (limited to 'Doc/library/threading.rst')
-rw-r--r-- | Doc/library/threading.rst | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Doc/library/threading.rst b/Doc/library/threading.rst index ec23504..00ae3ec 100644 --- a/Doc/library/threading.rst +++ b/Doc/library/threading.rst @@ -174,6 +174,12 @@ initial value is inherited from the creating thread. The flag can be set through the :attr:`~Thread.daemon` property or the *daemon* constructor argument. +.. note:: + Daemon threads are abruptly stopped at shutdown. Their resources (such + as open files, database transactions, etc.) may not be released properly. + If you want your threads to stop gracefully, make them non-daemonic and + use a suitable signalling mechanism such as an :class:`Event`. + There is a "main thread" object; this corresponds to the initial thread of control in the Python program. It is not a daemon thread. |