select() failure

Sigbjorn Finne sof at galois.com
Thu Aug 29 16:48:21 EDT 2002


"Dean Herington" <heringto at cs.unc.edu> writes:
> >
> > The assumption is that FDs are marked as non-blocking, so this won't
> > be a problem. Do you have a good reason not to have your FDs marked
> > as such?
>
> One reason is complexity.  If  I mark my FDs with O_NONBLOCK, don't I need
to
> wrap a loop around the `threadWaitRead`/`fdRead` combination, repeating
when
> `fdRead` returns error `EAGAIN`?
>

Yes, but the alternative of not doing so is much worse IMHO (you're forced
to
limit yourself to 1-byte read()s to avoid blocking.)

--sigbjorn





More information about the Glasgow-haskell-bugs mailing list