Because of multithreading semantics, this is not reliable. This sentence is found in the Python documentation for "7.8.1 Queue Objects".
This scares me! Why would Queue.qsize(), Queue.empty( ), and a Queue.full() not be reliable? Looking at the source code of Queue.py, all 3 calls use a mutex (based on thread.allocate_lock()). Does this mean that the thread.allocate_lock() mechanism is not reliable (scary indeed) or does this have to do with other implementation details? Many thanks for explaining this mystery. Olaf -- http://mail.python.org/mailman/listinfo/python-list