[Haskell] Pugs gains SMP parallelism support.

Audrey Tang autrijus at gmail.com
Sat Oct 21 04:14:49 EDT 2006

I hacked +RTS -N support into Pugs today; here's a short writeup:

Pugs's current implementation for concurrent operations on lists is  
very naive:

             chan    <- newChan
             forM ([0..] `zip` xs) $ \(n, x) -> forkIO $ do
                 rv  <- runEvalIO env (reduce x)
                 writeChan chan (n, rv)
             fmap (map snd . sort) (replicateM (length xs) (readChan  

While the initial result on Linux 2.6 is encouraging, on OSX/Intel  
with two CPUs
it actually slightly slows down the program when running on -N2 or  
I wonder if there is a more efficient way doing this...


More information about the Haskell mailing list