Hi Bulat,

> btw, if all that you need is to limit amount of simultaneous
> System.Cmd.system calls, you may go from opposite side: wrap this call
> into semaphore:
>
> sem = unsafePerformIO$ newQSem numCapabilities
>
> mysystem = bracket_ (waitQSem sem) (signalQSem sem) . system
>
> and implement para as simple thread population:
>
> para = mapM_ forkIO

My main motivation is to limit the number of system calls, but it's
also useful from a user point of view if the system is doing a handful
of things at a time - it makes it easier to track what's going on.

I might try that tomorrow and see if it makes a difference to the
performance. While the majority of computation is in system calls,
quite a few of the threads open files etc, and having them all run in
parallel would end up with way too many open handles etc.

Thanks

Neil
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to