4 ms·
BSD folks are yawning right now.
by tus88 6y ago
BSD folks are yawning right now.
- ta8645 6y agoWhy?
- cyphar 6y agokqueue on FreeBSD is effectively like io_uring but has existed for much longer (and Windows I/O Completion Ports predate kqueue). kqueue also gives you a way to get system events which you can't get on Linux (it has an equivalent of cn_proc that isn't awful).
- yxhuvud 6y agoI would argue the api of kqueue is clunkier and less general. Io_uring can keep track of events through using event_fds, but yes, that is perhaps not optimal.
- cyphar 6y agoYes, sorry I muddled things up (and now the edit window has elapsed). io_uring isn't the same as kqueue because it doesn't permit asynchronous notification of job completion nor can you do more complicated chained operations, epoll is the Linux equivalent of kqueue (and in that comparison, kqueue is better).
- josephg 6y agoHuh? Kqueue is nice, but I don't think you'll get anywhere near the performance of io_uring out of kqueue: - kqueue only tells you there's data to read (/space in the write buffer). You still need to call read() or write(), including paying the cost of the syscall. io_uring lets you batch a lot of read/write calls together and either issue a single syscall to the kernel for all calls, or have the kernel poll and never syscall at all. - kqueue doesn't let you issue fsync, or any of the other syscalls now in io_uring. fsync is essential on the write path for correctness in lots of cases, and for that you still need to dispatch to a local thread pool or something. So yeah, I prefer kqueue over linux's epoll. But io_uring seems like the new king.
- cyphar 6y agoAs the other commentor pointed out, I was wrong -- I'd mixed up the correspondence between kqueue and epoll with io_uring. Yeah kqueue doesn't allow asynchronous operations. Sadly I can't delete or edit my comment.