<br><font size=2 face="sans-serif">Hi,</font>
<br>
<br><font size=2 face="sans-serif">I'm trying to pass data between threads A and B. A notifies B to produce something </font>
<br><font size=2 face="sans-serif">and now I want the reference to the produced instance back in thread A. </font>
<br><font size=2 face="sans-serif">The documentation for threading.Condition proposes something like</font>
<br>
<br><font size=2 face="sans-serif"> # Consume one item</font>
<br><font size=2 face="sans-serif"> cv.acquire()</font>
<br><font size=2 face="sans-serif"> while not an_item_is_available():</font>
<br><font size=2 face="sans-serif"> cv.wait()</font>
<br><font size=2 face="sans-serif"> get_an_available_item()</font>
<br><font size=2 face="sans-serif"> cv.release()</font>
<br>
<br><font size=2 face="sans-serif">for the consumer side. I don't understand the while loop around</font>
<br><font size=2 face="sans-serif">the cv.wait() statement -- wouldn't cv.wait() block anyway until </font>
<br><font size=2 face="sans-serif">cv.notify() has been called in the other thread?</font>
<br>
<br><font size=2 face="sans-serif">Lars</font>
<br>