
25 Dec
2005
25 Dec
'05
7:59 a.m.
Tomasz Zielonka writes:
wc :: String -> (Int, Int, Int) wc file = ( length (lines file) , length (words file) , length file )
I have a crazy idea: what if we computed all three length applications concurrently, with the RTS preempting the thread when it generates too much unreclaimable nodes?
That's a pretty good idea, actually. What is the state of the 'par' primitive in GHC 6.x? Now that I think of it, it seems that adding a proper "compute in parallel" annotation could make a big difference in this case. Peter