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

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



On Mon, Oct 26, 2009, Evan Klitzke wrote:

> In this example the other thread will have "stolen" your data, and
> your callback may then block when it tries to read. However, this
> example seems a bit unlikely to me; it would be a terrible program
> that was susceptible to this race, and I see the O_NONBLOCK usage in
> single-threaded programs. So are there any other legitimate uses for
> this pattern?

Some code I've seen will continuously read from the buffer until
EWOULDBLOCK is returned; same for writing. Same for accept() too.

2c,


Adrian

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