examples of realistic multiprocessing usage?

Adam Skutt askutt at gmail.com
Mon Jan 17 07:05:36 EST 2011


On Jan 17, 12:44 am, TomF <tomf.sess... at gmail.com> wrote:
> Thanks for your reply.  I can enqueue all the jobs before waiting for
> the results, it's just that I want the parent to process the results as
> they come back.  I don't want the parent to block until all results are
> returned.  I was hoping the Pool module had a test for whether all
> processes were done, but I guess it isn't hard to keep track of that
> myself.
>

Regardless of whether it does or doesn't, you don't really want to be
blocking in two places anyway, so the "FINISHED" event in the queue is
the superior solution.

It's certainly possible to build a work pool w/ a queue such that you
block on both for entries added to the queue and job completion, but
I'm pretty sure it's something you'd have to write yourself.

Adam



More information about the Python-list mailing list