[Haskell-cafe] forkIO on multicore[MESSAGE NOT SCANNED]

Paul Keir pkeir at dcs.gla.ac.uk
Tue Dec 23 13:27:00 EST 2008

Hi Duncan,

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)
>   where
>     fibs = n : (n+1) : zipWith (+) fibs (tail fibs)


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20081223/d85eb477/attachment.htm

More information about the Haskell-Cafe mailing list