Dusan Kolar wrote:
Dear all,
I've thought the following three (dummy) programs would run some of
their parts in parallel (on dual core) if compiled with option threaded
(smp). The truth is that only the first one exploits multicore CPU. Why?
h1 <- forkIO $ putMVar v1 $ fibs (n-1)
You are putting an unevaluated thunk in the MVar. Try:
h1 <- forkIO (putMVar v1 $! fibs (n-1))
Zun.
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe