Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 439bdb1 commit 38b8254Copy full SHA for 38b8254
1 file changed
Doc/library/threading.rst
@@ -244,6 +244,12 @@ is that the entire Python program exits when only daemon threads are left.
244
The initial value is inherited from the creating thread. The flag can be
245
set through the :attr:`~Thread.daemon` property.
246
247
+.. note::
248
+ Daemon threads are abruptly stopped at shutdown. Their resources (such
249
+ as open files, database transactions, etc.) may not be released properly.
250
+ If you want your threads to stop gracefully, make them non-daemonic and
251
+ use a suitable signalling mechanism such as an :class:`Event`.
252
+
253
There is a "main thread" object; this corresponds to the initial thread of
254
control in the Python program. It is not a daemon thread.
255
0 commit comments