
Is it possible to use the forkIO primitive to cause pure computations to be evaluated in parallel threads? It seems to me that laziness would always prevent any evaluation until the result was used in a consuming thread (and hence would occur serially, in that thread). Tim -----Original Message----- From: haskell-cafe-bounces@haskell.org [mailto:haskell-cafe-bounces@haskell.org] On Behalf Of Bulat Ziganshin Sent: Tuesday, 6 November 2007 10:59 AM To: Andrew Coppin Cc: haskell-cafe@haskell.org Subject: Re: [Haskell-cafe] Go parallel Hello Andrew, Monday, November 5, 2007, 11:12:33 PM, you wrote:
How do I alter this to compute fn in multiple threads in parallel? (As
jobs :: [IO()] let fork job = do mvar <- newEmptyMVar forkIO$ do job; putMVar mvar () return mvar tasks <- mapM fork jobs mapM_ takeMVar tasks these runs jobs and waits before all them will be finished -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe