Re: epoll reporting events when it hasn't been asked to

Davide Libenzi
2004-04-02T15:22:36Z

On Fri, 2 Apr 2004, Ben Mansell wrote:

> > If an exception occurs (example a socket is disconnected) the socket
> > should be removed from the fd list. There is really no point in passing
> > in an excepted fd.
>
> Is there any difference, speed-wise, between turning off all events to
> listen to with EPOLL_MOD, and removing the file descriptor with
> EPOLL_DEL? I had vaguely assumed that the former would be faster
> (especially if you might later want to resume listening for events),
> although that was just a guess.

It is faster. OTOH nothing prevent you to use your current method. You
have only to handle exceptional condition instead of ignoring them.
Handling by, for example, removing the fd from the epoll set and
unregistering/freeing the associated data structures. IMO we can leave the
current behaviour, but if someone sees huge problems with this, the fix is
a one-liner.

- Davide