On May 17, 2:23 pm, Jeff <[EMAIL PROTECTED]> wrote: > Your worker threads wait around forever because there is no place for > them to exit. Queue.get() by default blocks until there is an item in > the queue available. You can do something like this to cause the > worker to quit when the queue is empty. Just make sure that you fill > the queue before starting the worker threads. > > from Queue import Queue, Empty > > # in your worker > while True: > try: > item = q.get(block=False) > except Empty: > break > do_something_with_item() > q.task_done() > > You can also use a condition variable and a lock or a semaphore to > signal the worker threads that all work has completed.
Thanks a lot, it works! Alex -- http://mail.python.org/mailman/listinfo/python-list