aboutsummaryrefslogtreecommitdiff
path: root/src/unix/loop.c
diff options
context:
space:
mode:
authorAndy Pan <i@andypan.me>2024-07-30 07:59:41 +0800
committerGitHub <noreply@github.com>2024-07-29 19:59:41 -0400
commite5cb1d3d3d4ab3178ac567fb6a7f0f4b5eef3083 (patch)
tree912dc7aa7a8067ccd27a2eba91b98dfa68ffe962 /src/unix/loop.c
parent63b22be08375372c429ec83e7a933a643adfd73c (diff)
downloadlibuv-e5cb1d3d3d4ab3178ac567fb6a7f0f4b5eef3083.tar.gz
libuv-e5cb1d3d3d4ab3178ac567fb6a7f0f4b5eef3083.zip
linux: eliminate a read on eventfd per wakeup (#4400)
Register the eventfd with EPOLLET to enable edge-triggered notification where we're able to eliminate the overhead of reading the eventfd via system call on each wakeup event. When the eventfd counter reaches the maximum value of the unsigned 64-bit, which may not happen for the entire lifetime of the process, we rewind the counter and retry. This optimization saves one system call on each event-loop wakeup, eliminating the overhead of read(2) as well as the extra latency for each epoll wakeup.
Diffstat (limited to 'src/unix/loop.c')
0 files changed, 0 insertions, 0 deletions