3 ms·
Disk I/O. It's basically all blocking except the fairly recent io_uring which is much more than disk I/O and perhaps a bit daunting for "I want to write some da
by jzwinck 4y ago
Disk I/O. It's basically all blocking except the fairly recent io_uring which is much more than disk I/O and perhaps a bit daunting for "I want to write some data without starving my main thread." I wish you could use select() and poll() on regular files on disk, like you can for almost all other file descriptors.
- viraptor 4y agoWhy not spawn a thread for disk io? It's a common pattern and frees up your main thread.
- jzwinck 4y agoSure, every application does that, but the kernel could do it better. What if I'm writing to two filesystems and one of them might have high latency sometimes? Do I make two threads for disk I/O to avoid starving one write when another is slow? The reasons for multiplexing network I/O apply to disk as well.