Project

General

Profile

Actions

Feature #12902

closed

epoll should nominally support EPOLLEXCLUSIVE

Added by Patrick Mooney about 2 years ago. Updated almost 2 years ago.

Status:
Closed
Priority:
Normal
Category:
kernel
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

As of version 4.5, Linux as supported the EPOLLEXCLUSIVE flag on events. The man page describes it as such:

Sets an exclusive wakeup mode for the epoll file descriptor that is being attached to the target file descriptor, fd. When a wakeup event occurs and multiple epoll file descriptors are attached to the same target file using EPOLLEXCLUSIVE, one or more of the epoll file descriptors will receive an event with epoll_wait(2). The default in this scenario (when EPOLLEXCLUSIVE is not set) is for all epoll file descriptors to receive an event. EPOLLEXCLUSIVE is thus useful for avoiding thundering herd problems in certain scenarios.

If the same file descriptor is in multiple epoll instances, some with the EPOLLEXCLUSIVE flag, and others without, then events will be provided to all epoll instances that did not specify EPOLLEXCLUSIVE, and at least one of the epoll instances that did specify EPOLLEXCLUSIVE.

That final sentence gives us an escape hatch, since it seems that implementing EPOLLEXCLUSIVE as a no-op would still be correct within the semantics.

Until someone is compelled to implement the full functionality, we should at least provide the same header definition and error handling . (Later parts of the man page describe extra input verification with EPOLLEXCLUSIVE set.)

Actions

Also available in: Atom PDF