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

Bulat Ziganshin bulat.ziganshin at gmail.com
Tue Apr 7 11:45:31 EDT 2009

Hello Neil,

Tuesday, April 7, 2009, 7:33:25 PM, you wrote:
>> How about using unsafeInterleaveIO to get a lazy suspension of the result of each action,
>>  and then using par to spark off each of them? If that works you can reuse the existing
>> task-parallel system of GHC to do the heavily lifting for you, instead of having to write your
>> own.

> par is likely to spark all the computations, and then switch between
> them - which will mean I've got more than N things running in
> parallel.

par/GHC RTS limits amount of Haskell threads running simultaneously.
with a system call marked as safe, Capability will be freed while we
execute external program so nothing will be limited except for amount
of tasks *starting* (as opposite to running) simultaneously :)))

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

More information about the Haskell-Cafe mailing list