In article <[EMAIL PROTECTED]>,
Jonathan Amsterdam <[EMAIL PROTECTED]> wrote:
>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.

That's not a problem in the design of the queue class, it is a problem
in how you are using it.  Two possible solutions are:

1. Don't have the global lock on the object (or, at the very least,
   don't have that global lock taken when you read from the queue).
2. Don't use a syncronized queue.  If the only access to the queue is
   through the object and the object is protected then you don't need
   a synchronized queue.

Alan
-- 
Defendit numerus
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to