[Haskell-cafe] True parallelism missing :-(

Dusan Kolar kolar at fit.vutbr.cz
Tue Mar 25 12:24:25 EDT 2008


Yes, that's is. Thanks. My fault - missing wood seeing trees. ;-)

Best regards,

Dusan

Roberto Zunino wrote:
> 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.



More information about the Haskell-Cafe mailing list