Problem with queue.join() hang/deadlock when using threading but only with python 2.7.2 on oneiric

Asked by Lars Nordin on 2012-06-13

I have a problem using queue.join() that causes my threaded script to deadlock.

The script is based off of the example code in The only differences is that the main thread fills the job queue first then spawns threads (afterwards calls queue.join() - as in the example program).

This program ran/runs without issue for over a hundred times with python v2.6.6 on Ubuntu v10.10 (recently upgraded to Ubuntu v11.10).

The program seems stable on Ubuntu v11.10 but only when using python v2.6.7 (python2.6 pkg: 2.6.7-4ubuntu1)

Python v2.7 info:
python -V: Python 2.7.2+
Ubuntu package: python 2.7.2-7ubuntu2

Question information

Lars Nordin (lnordin) said : #1

Addition: another difference with the example program is that my version does a non-blocking fetch from the queue ("queue.get(False)") and the Queue.empty exception is caught.

Anyway, as I said before the script runs fine on python v2.6

Can you help with this problem?

Provide an answer of your own, or ask Lars Nordin for more information if necessary.

To post a message you must log in.