event-loop: Track timer event sources in userspace

Graphics / Wayland / Wayland - Manuel Stoeckl [mstoeckl.com] - 21 January 2020 11:31 EST

libwayland now uses only one file descriptor to keep track of all the timer event sources associated with an event loop. An array-based binary heap is used to determine which event source has the earliest deadline.

(Previously, each timer event source had its own timerfd, making it easy for the a process using many timer event sources to run out of file descriptors.)

60a8d29 event-loop: Track timer event sources in userspace
src/event-loop.c | 444 +++++++++++++++++++++++++++++++++++++++++++++++++++----
1 file changed, 415 insertions(+), 29 deletions(-)

Upstream: cgit.freedesktop.org


  • Share