You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, we use pipe to interrupt the epoll_wait, which requires two file descriptors. Furthermore, given its complexity inside, pipe is a bit heavyweight for just a simple event wait/notify mechanism.
eventfd would be a more suitable solution for the current netpoll with epoll in Go, kernel also advocates for developers to use eventfd instead of pipe in some simple scenarios:
Applications can use an eventfd file descriptor instead of a pipe
(see pipe(2)) in all cases where a pipe is used simply to signal
events. The kernel overhead of an eventfd file descriptor is
much lower than that of a pipe, and only one file descriptor is
required (versus the two required for a pipe).
eventfd has been available since Linux 2.6.22 and eventfd2 has been available since Linux 2.6.27, the minimal kernel version for Go is 2.6.32, so we're good to go.
The text was updated successfully, but these errors were encountered: