Python 2.6's multiprocessing lock not working on second use?

Gabriel Genellina gagsl-py2 at
Sat Jan 17 11:32:35 CET 2009

En Fri, 16 Jan 2009 14:41:21 -0200, escribiste en el grupo

> I ran a few tests on the new Python 2.6 multiprocessing module before
> migrating a threading code, and found out the locking code is not
> working well. In this case, a pool of 5 processes is running, each
> trying to get the lock and releasing it after waiting 0.2 seconds
> (action is repeated twice). It looks like the multiprocessing lock
> allows multiple locking after the second pass. Running the exact same
> code with threads works correctly.

I've tested your code on Windows and I think the problem is on the Queue
class. If you replace the Queue with some print statements or write to a
log file, the sequence lock/release is OK.
You should file a bug report on

Gabriel Genellina

More information about the Python-list mailing list