3 ms·
"Not every IO operation can be performed asynchronously though. File IO is perhaps the best example of this (at least on Linux). To handle such cases, languages
by weinzierl 2y ago
"Not every IO operation can be performed asynchronously though. File IO is perhaps the best example of this (at least on Linux). To handle such cases, languages must provide some sort of alternative strategy such as performing the work in a dedicated pool of OS threads."
Can someone explain, why this would be the case?
- Why can't every IO op be async?
- Why is file IO on Linux not async?
- What does iouring have to do with it?
- seanhunter 2y agoFile IO can absolutely be async on linux[1] and this has been supported since version 2.5 or something provided that the device supports it (which they all have since about 2000). io_uring was the syscall interface that was introduced in 5.1 to improve async file i/o performance so it is relevant in that the previous way to do it wasn't great. [1] https://kkourt.io/blog/2017/10-14-linux-aio.html https://kkourt.io/blog/2017/10-14-linux-aio.html <- note the 2017 date.
- yencabulator 2y agoIn-kernel file or block I/O is async if the driver/file implemented the async operations. If not, it's blocking. io_uring is a relatively new userspace syscall API to minimize the number of syscalls used for I/O, and to provide a common mechanism for doing many kinds of operations. Previously, large numbers of syscalls could become a bottleneck for busy applications, and some kinds of operations did not have a usable non-blocking interface.