
13 Dec
2010
13 Dec
'10
2:17 a.m.
On Mon, Dec 13, 2010 at 1:37 AM, Mathijs Kwik
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