Multiprocessing.Queue - I want to end.

Luis Alberto Zarrabeitia Gomez kyrie at uh.cu
Mon May 4 07:02:36 CEST 2009


Quoting Dennis Lee Bieber <wlfraed at ix.netcom.com>:

> 	I'm not familiar with the multiprocessing module and its queues but,
> presuming it behaves similar to the threading module AND that you have
> design control over the consumers (as you did in the sample) make a
> minor change.
> 
> 	queue.put(None)	ONCE in the producer
> 
> 	Then, in the consumer, after it sees the None and begins shutdown
> processing, have the consumer ALSO do
> 
> 	queue.put(None)
> 

Thank you. I went with this idea, only that instead of modifying the consumer, I
modified the queue itself... Well, Cameron Simpson did :D. It's working nicely now.

-- 
Luis Zarrabeitia
Facultad de Matemática y Computación, UH
http://profesores.matcom.uh.cu/~kyrie

-- 
Participe en Universidad 2010, del 8 al 12 de febrero de 2010
La Habana, Cuba 
http://www.universidad2010.cu




More information about the Python-list mailing list