Check out my first novel, midnight's simulacra!

Epoll

From dankwiki
Revision as of 07:48, 14 May 2023 by Dank (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

I don't like epoll so much as FreeBSD's kqueue, although many of its deficiencies have been overcome with the 2.6.25 kernel release and its addition of timerfd_* and signalfd_* functionality (LWN had a good article regarding timerfd here). Note that these latter functions require glibc version 2.8 or later, or use of the syscall() multiplexer. EPOLLRDHUP was not added until 2.6.17.

EPOLLEXCLUSIVE was added in Linux 4.5, and wakes up only one thread for events when multiple threads are blocking on epoll.

System Limits

  • /proc/sys/fs/epoll/max_user_watches, since Linux 2.6.28, "specifies a limit on the total number of file descriptors that a user can register across all epoll instances on the system. The limit is per real user ID. Each registered file descriptor costs roughly 90 bytes on a 32-bit kernel, and roughly 160 bytes on a 64-bit kernel. Currently, the default value for max_user_watches is 1/25 (4%) of the available low memory, divided by the registration cost in bytes."

External links