How is non-blocking IO working ?

Ahn Ki-yung kyagrd@bawi.org
Fri, 04 Apr 2003 01:25:25 +0900


Document says GHC uses non-blocking IO to be
thread friendly. But if it continues to poll on the
non blocking file descriptor. It should cost much
CPU load, but actually it doesn't :
for example if a server is wating an input from
a connected client, say using hGetLine, until
input comes in from the network it should
continue to poll until it succeeds to get some
messages. But this does not seem to happen,
if I look at the prcessor activity using 'top'.
It does not consume CPU same as a blocked
processed by blocked IO.

How is non-blocking and thread working ?
I can't understand.