[Haskell-cafe] forkIO on multicore

Felipe Lessa felipe.lessa at gmail.com
Fri Dec 19 11:31:20 EST 2008


On Fri, Dec 19, 2008 at 2:27 PM, Paul Keir <pkeir at dcs.gla.ac.uk> wrote:
> I'm seeing no performance increase with a simple coarse-grained
> 2-thread code using Control.Concurrent. I compile with:

I didn't test your code, but

[...]
> fibs = 0 : 1 : zipWith (+) fibs (tail fibs)
> heavytask m = putMVar m (fibs !! 100000)
[...]

probably fibs is being calculated only once, so just one thread
calculates (fibs !! 100000) while others just keep waiting for the
result.

-- 
Felipe.


More information about the Haskell-Cafe mailing list