On Mon, Dec 13, 2010 at 1:37 AM, Mathijs Kwik <bluescreen...@gmail.com> wrote: > Hi all, > > I read the paper about the new ghc7 event handling IO manager goodies. > This is all very exciting stuff. I didn't know GHC's RTS had these > smart async-IO facilities. > The paper pointed me at threadWaitRead/threadWaitWrite. > While very nice the way they are, I would also like to be able to wait > on more than 1 fd until 1 of them becomes available.
You can fork a thread per fd and have the first thread that wakes up kill the other threads using asynchronous exceptions. This is how e.g. System.Timeout.timeout works. Johan _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe