>>>>> "Paul McGuire" <[EMAIL PROTECTED]> (PM) wrote:

>PM> "Jonathan Amsterdam" <[EMAIL PROTECTED]> wrote in message
>PM> news:[EMAIL PROTECTED]
>>> If you don't want to call it deadlock, fine, but the program execution
>>> I describe will make no progress to the end of time. Thread 2 can never
>>> put anything in the queue, because Thread 1 holds M, and Thread 1 will
>>> never release M because that can only happen if someone puts something
>>> on the queue.
>>> 

>PM> Ah, I get it now, and yes as you describe it, this is a deadlock.  But why
>PM> do you need both mutex M and a Queue, then?  You should release M before
>PM> calling Queue.get().  Then if you need to, you should reacquire it
>PM> afterward.

What Jonathan says is that in his example M and the mutex for the Queue
should be the same to solve the problem. And that the Queue API should
allow you to do that. I think he is right.
-- 
Piet van Oostrum <[EMAIL PROTECTED]>
URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C4]
Private email: [EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to