[Haskell-cafe] Go parallel

Bulat Ziganshin bulat.ziganshin at gmail.com
Mon Nov 5 18:59:02 EST 2007

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 at gmail.com

More information about the Haskell-Cafe mailing list