21 Oct
2006
21 Oct
'06
8:14 a.m.
I hacked +RTS -N support into Pugs today; here's a short writeup: http://pugs.blogs.com/pugs/2006/10/smp_paralleliza.html 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 chan)) 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 above. I wonder if there is a more efficient way doing this... Thanks, Audrey