Re: [RFC PATCH] poll(): add poll_wait_set_exclusive()

Davide Libenzi
2010-10-31T23:03:21Z

On Thu, 7 Oct 2010, Mathieu Desnoyers wrote:

> > Also, doesn't eventpoll already support exclusive polling? I dunno.
> > Davide might be interested in the discussion regardless.
>
> Looking at epoll(7), the behavior of EPOLLONESHOT when there are multiple epoll
> instances monitoring a file descriptor seems unclear: does it stop event
> propagation after delivery to the first epoll instance (this is the behavior I
> am looking for), or does it stop the event delivery after having woken up all
> epoll instances monitoring the file descriptor ? Davide might have the answer to
> this one.

Sorry for the late response, but I am very slowly wroking my way through a
long backlog.
In your case above, both fds will get event report, in epoll, with
EPOLLONESHOT (because the one-shot applies to the epoll-fd/monitored-fd
pair/key).
As for the exclusive wakeup feature, I am not totally against it, though
it is borderline as far as use cases vs. added complexity.
The POLLEX/EPOLLEX would be nicer, if it wouldn't lead to a racy interface
(say one thread uses [E]POLLEX and the another not).
IMO this is more fcntl(2) flag territory, as the application would set the
behavior globally (for the file), though again, I am not sure the use
cases justify the introduction and handling of the new flag.

- Davide