4 ms·
All this fuss because Linux wouldn't just implement kQueue ... Sigh.
by bsder 6y ago
All this fuss because Linux wouldn't just implement kQueue ... Sigh.
- cyphar 6y agoSolaris didn't port kqueue either. We're doomed to reinvent the wheel.
- bsder 6y agoAnd Bryan Cantrill has expressed quite a bit of remorse about that.
- pengaru 6y agoPlease explain to me how kqueue facilitates submitting arbitrarily large numbers of syscalls to the kernel as a single syscall, to be performed asynchronously no less. Even potentially submitted using no syscall at all, in polling mode.
- gpderetta 6y agoLinux should have had kqueue instead of epoll. But io_uring is a different thing.
- cycloptic 6y agoAFAIK it's unnecessary at this point, Linux has most of the equivalent functionality and there is a shim library for it: https://github.com/mheily/libkqueue https://github.com/mheily/libkqueue
- gpderetta 6y agoyes, these days you can get a file descriptor for pretty much everything so epoll is sufficient. I think that epoll timeout granularity is still in milliseconds, so if you want to build high res timers on top of it for your event loop you have to either use zero timeout polling or use an explicit timerfd which adds overhead. I guess you can use plain ppoll (which has ns resolution timeouts) on the epoll fd.
- cycloptic 6y agoThis is corrected in io_uring too, if you use IORING_OP_TIMEOUT that takes a timespec64.