<p>I know you fixed the deadlock problem, but the warnings about shutdown misbehaviour are still valid. </p>
<p>--<br>
Sent from my phone, thus the relative brevity :) </p>
<div class="gmail_quote">On May 18, 2012 9:59 PM, "antoine.pitrou" <<a href="mailto:python-checkins@python.org">python-checkins@python.org</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<a href="http://hg.python.org/cpython/rev/565734c9b66d" target="_blank">http://hg.python.org/cpython/rev/565734c9b66d</a><br>
changeset: 77020:565734c9b66d<br>
parent: 77018:364289cc7891<br>
user: Antoine Pitrou <<a href="mailto:solipsis@pitrou.net">solipsis@pitrou.net</a>><br>
date: Fri May 18 13:57:04 2012 +0200<br>
summary:<br>
Remove outdated statements about threading and imports.<br>
<br>
files:<br>
Doc/library/multiprocessing.rst | 4 +--<br>
Doc/library/threading.rst | 23 ---------------------<br>
2 files changed, 1 insertions(+), 26 deletions(-)<br>
<br>
<br>
diff --git a/Doc/library/multiprocessing.rst b/Doc/library/multiprocessing.rst<br>
--- a/Doc/library/multiprocessing.rst<br>
+++ b/Doc/library/multiprocessing.rst<br>
@@ -120,9 +120,7 @@<br>
print(q.get()) # prints "[42, None, 'hello']"<br>
p.join()<br>
<br>
- Queues are thread and process safe, but note that they must never<br>
- be instantiated as a side effect of importing a module: this can lead<br>
- to a deadlock! (see :ref:`threaded-imports`)<br>
+ Queues are thread and process safe.<br>
<br>
**Pipes**<br>
<br>
diff --git a/Doc/library/threading.rst b/Doc/library/threading.rst<br>
--- a/Doc/library/threading.rst<br>
+++ b/Doc/library/threading.rst<br>
@@ -996,27 +996,3 @@<br>
Currently, :class:`Lock`, :class:`RLock`, :class:`Condition`,<br>
:class:`Semaphore`, and :class:`BoundedSemaphore` objects may be used as<br>
:keyword:`with` statement context managers.<br>
-<br>
-<br>
-.. _threaded-imports:<br>
-<br>
-Importing in threaded code<br>
---------------------------<br>
-<br>
-While the import machinery is thread-safe, there are two key restrictions on<br>
-threaded imports due to inherent limitations in the way that thread-safety is<br>
-provided:<br>
-<br>
-* Firstly, other than in the main module, an import should not have the<br>
- side effect of spawning a new thread and then waiting for that thread in<br>
- any way. Failing to abide by this restriction can lead to a deadlock if<br>
- the spawned thread directly or indirectly attempts to import a module.<br>
-* Secondly, all import attempts must be completed before the interpreter<br>
- starts shutting itself down. This can be most easily achieved by only<br>
- performing imports from non-daemon threads created through the threading<br>
- module. Daemon threads and threads created directly with the thread<br>
- module will require some other form of synchronization to ensure they do<br>
- not attempt imports after system shutdown has commenced. Failure to<br>
- abide by this restriction will lead to intermittent exceptions and<br>
- crashes during interpreter shutdown (as the late imports attempt to<br>
- access machinery which is no longer in a valid state).<br>
<br>
--<br>
Repository URL: <a href="http://hg.python.org/cpython" target="_blank">http://hg.python.org/cpython</a><br>
<br>_______________________________________________<br>
Python-checkins mailing list<br>
<a href="mailto:Python-checkins@python.org">Python-checkins@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/python-checkins" target="_blank">http://mail.python.org/mailman/listinfo/python-checkins</a><br>
<br></blockquote></div>