matt at whoosh.ca
Wed Mar 3 00:04:09 CET 2010
On 3/2/2010 3:59 PM, Matt Chaput wrote:
> I'm trying to use a simple pattern where a supervisor object starts a
> bunch of worker processes, instantiating them with two queues (a job
> queue for tasks to complete and an results queue for the results). The
> supervisor puts all the jobs in the "job" queue, then join()s the
> workers, and then pulls all the completed results off the "results"
> Here's a simplified example:
I should mention that if I change my code so the workers just pull
things off the job queue but don't put any results on the result queue
until after they see the None sentinel in the job queue and break out of
the loop, I don't get the deadlock. So it's something about getting from
one queue and putting to another queue in close proximity.
Hopefully I'm making a simple mistake with how I'm using the library and
it'll be easy to fix...
More information about the Python-list