Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

What does kqueue give that epoll doesn't?

Note also that signalfd() can do something similar to your dispatch_source.



Epoll is limited to file descriptors. Kqueue also supports waiting on process events (process exit, process fork, process exec, etc), on filesystem events, and a bunch of other things. Epoll also does not support batch updates and requires multiple system calls to apply updates for multiple file descriptors, while kqueue supports batch updating and polling in a single system call. All in all kqueue is just superior to epoll. See also http://pod.tst.eu/http://cvs.schmorp.de/libev/ev.pod for various ways in which epoll is broken (search for "The epoll mechanism deserves honorable mention as the most misdesigned of the more advanced event mechanisms")


Not to mention that kevent contain the number of bytes to be read, or the number of connections to accept, which can avoid you a system call that returns EAGAIN in a non-blocking socket.


I think the point is that libdispatch requires kqueue, so you can't use it on Linux.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: