[Python-checkins] cpython (merge 3.2 -> 3.3): Issue #17208: add a note about the termination behaviour of daemon threads.
antoine.pitrou
python-checkins at python.org
Fri Feb 15 21:35:53 CET 2013
http://hg.python.org/cpython/rev/917ae89e59ce
changeset: 82213:917ae89e59ce
branch: 3.3
parent: 82209:3f8b5fcbf07e
parent: 82212:8753a3be4a3c
user: Antoine Pitrou <solipsis at pitrou.net>
date: Fri Feb 15 21:31:33 2013 +0100
summary:
Issue #17208: add a note about the termination behaviour of daemon threads.
files:
Doc/library/threading.rst | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/Doc/library/threading.rst b/Doc/library/threading.rst
--- a/Doc/library/threading.rst
+++ b/Doc/library/threading.rst
@@ -174,6 +174,12 @@
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.
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list