Re: and nicer too - Re: [PATCH] epoll more scalable than poll

John Gardiner Myers
2002-10-28T23:38:53Z

bert hubert wrote:

>The interface is also lovely:
>
>
The code you wrote has the standard epoll race condition. If the file
descriptor 's' becomes readable before the call to sys_epoll_ctl,
sys_epoll_wait() will never return the socket. The connection will hang
and the file descriptor will effectively leak.

As you have amply demonstrated, the current epoll API is error prone.
The API should be fixed to test the poll condition and, if necessary,
drop an event upon insertion to the set.