New patches: [Use STM in Conc.hs Tomasz Zielonka **20051122065752] { hunk ./Conc.hs 6 +import Control.Concurrent.STM hunk ./Conc.hs 15 -children = unsafePerformIO $ newMVar [] +children = unsafePerformIO $ atomically $ newMVar [] hunk ./Conc.hs 20 -parent = unsafePerformIO newChan +parent = unsafePerformIO $ atomically newChan hunk ./Conc.hs 28 - writeChan parent $ stamp ++ ": " ++ (show tid) ++ ": " ++ a + atomically $ writeChan parent $ stamp ++ ": " ++ (show tid) ++ ": " ++ a hunk ./Conc.hs 46 - do empty <- isEmptyChan parent - unless empty $ do x <- readChan parent - putStrLn x - alive <- isEmptyMVar die - when (alive || not empty) $ logger die + join $ atomically $ + (do x <- readChan parent + return $ do + putStrLn x + logger die) + `orElse` + (do takeMVar die + return (return ())) hunk ./Conc.hs 58 - logDie <- newEmptyMVar - logDead <- newEmptyMVar - l <- forkIO (logger logDie `finally` putMVar logDead ()) + logDie <- atomically newEmptyMVar + logDead <- atomically newEmptyMVar + l <- forkIO (logger logDie `finally` atomically (putMVar logDead ())) hunk ./Conc.hs 63 - do cs <- takeMVar children + do cs <- atomically (takeMVar children) hunk ./Conc.hs 65 - [] -> do putMVar die () - takeMVar dead + [] -> do atomically $ do + putMVar die () + takeMVar dead hunk ./Conc.hs 69 - m:ms -> do putMVar children ms - takeMVar m + m:ms -> do atomically $ do + putMVar children ms + takeMVar m hunk ./Conc.hs 76 - do mvar <- newEmptyMVar - childs <- takeMVar children - putMVar children (mvar:childs) - forkIO (io `finally` putMVar mvar ()) + do mvar <- atomically newEmptyMVar + atomically $ do + childs <- takeMVar children + putMVar children (mvar:childs) + forkIO (io `finally` atomically (putMVar mvar ())) hunk ./Conc.hs 84 + replace ./Conc.hs [A-Za-z_0-9] Chan TChan replace ./Conc.hs [A-Za-z_0-9] MVar TMVar replace ./Conc.hs [A-Za-z_0-9] newChan newTChan replace ./Conc.hs [A-Za-z_0-9] newEmptyMVar newEmptyTMVar replace ./Conc.hs [A-Za-z_0-9] newMVar newTMVar replace ./Conc.hs [A-Za-z_0-9] putMVar putTMVar replace ./Conc.hs [A-Za-z_0-9] readChan readTChan replace ./Conc.hs [A-Za-z_0-9] takeMVar takeTMVar replace ./Conc.hs [A-Za-z_0-9] writeChan writeTChan } Context: [free ssl handle, read chan 1 item/time, trace excepts joelr@well.com**20051119135750] [added crash dumps to readme joelr@well.com**20051119023717] [readme update joelr@well.com**20051119013400] [server.pem joelr@well.com**20051119011324] [updated readme joelr@well.com**20051119010300] [really small readme joelr@well.com**20051119005259] [launch 5000 clients, ulimit -n is your friend! joelr@well.com**20051119004928] [small comment joelr@well.com**20051119003032] [fully working joelr@well.com**20051119000227] [ssl handshake working, client blocking indefinitely joelr@well.com**20051118230017] [base joelr@well.com**20051118145241] Patch bundle hash: 663bcce41b9368ca66e8f674d7c8e6f4df3c3892