[Haskell-cafe] forkIO on multicore[MESSAGE NOT SCANNED]
pkeir at dcs.gla.ac.uk
Tue Dec 23 13:27:00 EST 2008
I'm following the story regarding (parallel) GC in this example
with interest, but forgive me if I ask a more minor question
regarding your modification of an extra parameter, "n", to
"heavytask". Does this really help (to ensure that each core
does work independently)? Surely, with fibs now described in a
where clause, the "0:1:etc." form would not be shared among the
(8) instantiations of "heavytask"?
> heavytask m n = putMVar m $! (fibs !! 100000)
> fibs = n : (n+1) : zipWith (+) fibs (tail fibs)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe