[Haskell-cafe] Re[8]: Parallel combinator, performance advice

Bulat Ziganshin bulat.ziganshin at gmail.com
Wed Apr 8 06:45:06 EDT 2009

Hello Neil,

Wednesday, April 8, 2009, 2:33:15 PM, you wrote:

> Yes, this saves us adding a kill job to the queue, but requires an
> extra MVar. I guess which one of these is to be preferred depends on
> performance measures.

i think that main problem with your last variant is that kill job
added to the queue much later than real jobs. imagine the following

1. para used to add 100 jobs to the queue
2. while these jobs are executing, para in another thread adds another
100 jobs to the queue

in my variant, first para exits just when its own jobs are completed.
in your variant, exit job is added to the queue only after second
batch of 100 jobs so we will wait until all these jobs are executed

Best regards,
 Bulat                            mailto:Bulat.Ziganshin at gmail.com

More information about the Haskell-Cafe mailing list