Re: Simple question about Queue.Queue and threads

2010-02-08 Thread Frank Millman
On Feb 8, 4:51 pm, Steven wrote: Queue objects have support for this signaling baked in with q.task_done and q.join. After the server process has put all tasks into the queue, it can join the queue itself, not the worker threads. q.join() This will block until all tasks have been gotten AND

Re: Simple question about Queue.Queue and threads

2010-02-08 Thread Steven
On Feb 5, 7:45 am, "Frank Millman" wrote: > Hi all > > Assume you have a server process running, a pool of worker threads to > perform tasks, and aQueue.Queue() to pass the tasks to the workers. > > In order to shut down the server cleanly, you want to ensure that the > workers have all finished t

Re: Simple question about Queue.Queue and threads

2010-02-05 Thread Frank Millman
On Feb 6, 7:59 am, "Gabriel Genellina" wrote: En Fri, 05 Feb 2010 09:45:30 -0300, Frank Millman 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 w

Re: Simple question about Queue.Queue and threads

2010-02-05 Thread Gabriel Genellina
En Fri, 05 Feb 2010 09:45:30 -0300, Frank Millman escribió: Assume you have a server process running, a pool of worker threads to perform tasks, and a Queue.Queue() to pass the tasks to the workers. In order to shut down the server cleanly, you want to ensure that the workers have all fi