[Haskell-cafe] You are in a twisty maze of concurrency libraries, all different ...

Ivan Lazar Miljenovic ivan.miljenovic at gmail.com
Fri Dec 4 06:52:33 EST 2009


Patrick Caldon <patc at pessce.net> writes:
> it takes about a second to run on a PC. It's functional except it
> whacks the rng, which needs IO. I run 5-10 of these jobs, and then
> use:

Which RNG are you using that it needs so much IO?

>
> mergeWorld :: [SimState] -> SimState
>
> to pick the best features of the runs and build another possible world
> (state).  Then I use this new world to run another 5-10 jobs and so
> on.  I run this through ~20000 iterations.
>
> It's an obvious place for parallelism.
>
> I'm looking for a concurrency library with something like:
>
> forkSequence :: Int -> [IO a] -> IO [a]
>
> which I could call with something like this:
>
> forkSequence 4 (take 10 (repeat  (runWorldSim g ss)))
>
> this would construct 4 threads, then dispatch the 10 jobs onto the
> threads, and pack up the
> results into a list I could run through my merger.
>
> It strikes me as something someone would already have done, but I
> can't find anything in hackage.  Probably I've missed something
> obvious?  Any pointers?
>
> If not, what would be the best/easiest existing package to write an
> extension to?
>
> Thanks,
> Patrick.
>
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe

-- 
Ivan Lazar Miljenovic
Ivan.Miljenovic at gmail.com
IvanMiljenovic.wordpress.com


More information about the Haskell-Cafe mailing list