Comment by adzm
15 hours ago
I love NT's IO completion ports. I think kqueue is very similar, right? Honestly I've been able to get by using boost asio for cross platform needs but I've always wanted to see if there are better solutions. I think libuv is similar, since it is what node is based on, but I'm not entirely sure what the underlying tech is for non-Windows
kqueue is similar to epoll, it's readiness based and not completion like IOCP and io_uring. IOCP is nice in theory, but the api and the different ways everything has to be fed for it leaves a lot to be desired... Windows also has own version of iouring, but it's bit abandoned and only works for disk io which is shame, because it could have been nice new clean io api for windows.
I don't know how it compares, but for sockets Windows also has Registered I/O: https://learn.microsoft.com/en-us/previous-versions/windows/...
> the api and the different ways everything has to be fed for it leaves a lot to be desired
I think Microsoft fixed that in Windows Vista by providing a higher-level APIs on top of IOCP. See CreateThreadpoolIo, CloseThreadpoolIo, StartThreadpoolIo, and WaitForThreadpoolIoCallbacks WinAPI functions.
I’ve been enjoying the rust compio library lately which abstracts over io_uring on Linux. And IOCP and friends on windows. And it falls back to kqueue on macOS and presumably FreeBSD.
It’s wonderful being able to write straightforward code that works fast on every platform with no code changes.
I guess the strength of rust (and zig for now) is that the community has a chance to explore lots of different ways to solve these problems. And the corresponding weakness is that everyone uses different libraries, so it’s a fragmented ecosystem full of libraries that may or may not work together properly.