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

Dirk Morris
2004-04-14T17:59:47Z

Davide Libenzi wrote:

>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.
>>
>>

I'd like to weigh in on this issue as I'm having the same issue as Ben.
My application doesnt consider these to be exceptional events, but
normal expected events, and thus
I need them to be handled like normal events. (I can explain more off
list if you'd like)
So I just want to ignore all events for some time and then deal with any
HUP's or ERR's at the appropriate time.
When I used poll(), I always accomplished this by leaving this fd out of
the poll fd set.
This wasnt a huge hit because I basically had to rebuild the poll fd set
at every iteration anyway as it changes rapidly.

Now I'm switching to epoll, and the great thing about the epoll
interface is I don't have to rebuild the entire fd set at every iteration.
Like Ben, I'd prefer to be able to disable ALL events on a fd descriptor
for some time, instead of removing it entirely.
Since with poll I had to rebuild the set anyway, this 'disable' feature
wasnt really useful, but would be a nice-to-have for epoll.
:))