
Hello Joel, Tuesday, December 06, 2005, 6:42:32 PM, you wrote: JR> On Dec 6, 2005, at 1:47 PM, Bulat Ziganshin wrote:
either 1) use MVars/TMVars instead of Channels. in any case your logging thread must consume data not slower than other channels produce then. in fact, using Chan have meaning only to smooth temporary speed differences between different threads. are you really need this??
btw, why not pass to worker thread just the logging action itself? and, about waitForChildren: waitForChildren :: IO () waitForChildren = do logDead <- newEmptyMVar forkIO (logger `finally` putMVar logDead ()) c <- takeMVar children mapM_ takeMVar c ...send Nothing to logger thread takeMVar logDead as simple as possible -- Best regards, Bulat mailto:bulatz@HotPOP.com