Re: multiprocessing: queue.get() blocks even if queue.qsize() != 0

2008-10-21 Thread Antoon Pardon
On 2008-10-15, redbaron [EMAIL PROTECTED] wrote: I run into problem with queue from multiprocessing. Even if I queue.qsize() != 0 queue.get() still blocks and queue.get_nowait() raises Emtpy error. I'm unable to cut my big part to small test case, because smaller test case similair to my

Re: multiprocessing: queue.get() blocks even if queue.qsize() != 0

2008-10-21 Thread Paul Rubin
redbaron [EMAIL PROTECTED] writes: while qresult.qsize(): result = qresult.get() #this code blocks! doWithResult(result) That is unreliable for the reason Antoon explained, and as is documented in the manual for the Queue module. Write instead something like (untested): while

multiprocessing: queue.get() blocks even if queue.qsize() != 0

2008-10-15 Thread redbaron
I run into problem with queue from multiprocessing. Even if I queue.qsize() != 0 queue.get() still blocks and queue.get_nowait() raises Emtpy error. I'm unable to cut my big part to small test case, because smaller test case similair to my real app by design is works. In what conditions is it

Re: multiprocessing: queue.get() blocks even if queue.qsize() != 0

2008-10-15 Thread MRAB
On Oct 15, 2:05 pm, redbaron [EMAIL PROTECTED] wrote: I run into problem with queue from multiprocessing. Even if I queue.qsize() != 0 queue.get() still blocks and queue.get_nowait() raises Emtpy error. I'm unable to cut my big part to small test case, because smaller test case similair to