threading/Queue: join() and task_done() not working? (deadlock)

Gal Aviel galaviel at yahoo.com
Wed Feb 27 14:06:56 EST 2008


Hello All,

I'm seeing strange behavior where one thread waits on a queue using join() and
the later (or so I think, according to order of the printing in STDOUT) another
thread calls task_done() on the very same queue, however the first thread does
not wake up, it keeps blocking forever.

I'm using a queue of size 1, my print's:

# @115000       : DEBUG      PY wait(): waiting for task_done
#                on <Queue.Queue instance at 0x416c7a8c>
# @115000       : DEBUG      PY callback_cb() - 2
# @115000       : DEBUG      PY callback_cb() - signaling
#                task_done on <Queue.Queue instance at 0x416c7a8c>
# @115000       : DEBUG      PY callback_cb() - 3

As you can see, the queue object is the same on both threads. 

Any help would be greatly appreciated, since I've spent days and days on this
already !!

Python 2.5.1, SUSE LINUX Enterprise Server 9.

Thanks in advance, Gal Aviel.








More information about the Python-list mailing list