my threaded program hangs after calling Queue.join()

Peter Otten __peter__ at web.de
Tue Apr 6 08:32:13 EDT 2010


Babu wrote:

> I am not an expert in python, so any help is my appreciated.  My
> threaded program consumed everything in the queue but is not
> exiting... What is the problem with this program?

Perhaps it's waiting for the task_done() call associated to the (None, None) 
pairs.

>                         if host is None:
                                  Q_in.task_done()
>                                 break # reached end of queue

The same problem could occur when an exception is raised.

Peter



More information about the Python-list mailing list