4 ms·
I have used select and poll before and sort of skipped to io_uring for a recent project, which also doesn't do too well with multiple threads (you have to use m
by dxuh 4y ago
I have used select and poll before and sort of skipped to io_uring for a recent project, which also doesn't do too well with multiple threads (you have to use multiple rings and do everything else yourself). It's a shame that there is no obvious, relatively easy to use async IO mechanism on Linux that you can use from multiple threads without getting yourself in trouble. Reading more about kqueue it looks a lot like something that would solve it. Why was it not ported to Linux? Would it have been too hard to integrate?
The linked article is great btw. Very informative and concise!
- kasabali 4y ago> Why was it not ported to Linux? NIH
- ilyt 4y ago> I have used select and poll before and sort of skipped to io_uring for a recent project, which also doesn't do too well with multiple threads (you have to use multiple rings and do everything else yourself Wouldn't that be on purpose ? Coordination requires more cpu cycles and so cuts on max performance > Why was it not ported to Linux? We've been asking since epoll got introduced. But here is some context: https://lwn.net/Articles/431297/ https://lwn.net/Articles/431297/
- LaLaLand122 4y ago> you have to use multiple rings and do everything else yourself Since you are supposed to use liburing, not the kernel interface directly, I guess somebody could add multithreading "support" to it. Or at least add documentation/examples of the most common/performant options: https://github.com/shuveb/loti/issues/4 https://github.com/shuveb/loti/issues/4 AFAIR Windows IOCP handles multithreading by: - Handling locking at kernel level, the syscall is thread safe - Making it LIFO, to keep things in the same threads, to have a decent cache behaviour. It's as simple as it gets.