[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [Libevent-users] O_NONBLOCK and select/epoll/libevent



Eric M. Hopper wrote:
Yes.  It's often a good idea, for efficiency reasons, to read
continuously from a socket until you get an EWOULDBLOCK error.  You're
saving yourself the overhead of going back to the event loop just to
have it call epoll, have it return and have you read more from the
socket.
If you want to be portable to Windows, its a good habit to get, because its the re-enabler for another read indicator. If you have problematic scheduling and fairness, then just keep track of which sockets haven't been definitively drained yet and process them as if they were causing select to return. (ie select with immediate timeout iif any exist, and inject them into
the active socket set).

***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users    in the body.