Simple question about Queue.Queue and threads

Frank Millman frank at chagford.com
Sat Feb 6 01:30:55 EST 2010


On Feb 6, 7:59 am, "Gabriel Genellina" <gagsl-... at yahoo.com.ar> wrote:
> En Fri, 05 Feb 2010 09:45:30 -0300, Frank Millman <fr... at chagford.com> 
> escribió:
>
[...]
> > However, the queue is not empty - it still has the final None in it.
>
> Yes - but who cares? :)
>

That was my point. I didn't think I needed to care, but I wanted to be sure 
I was not missing something.

I will just discard all the final cleanup code.

>
> (BTW, I'd use a different sentinel instead of None; perhaps this could not 
> happen in your current code, but it's easy to inadvertedly put a None in 
> the queue, stopping all workers prematurely.)
>

Good advice.

Thanks, Gabriel

Frank





More information about the Python-list mailing list