4 ms·
No no no, we need async I/O for files. Writing should not be synchronous, but you should be able to find out about completion of each write. Asynchrony is abs
by cryptonector 9y ago
No no no, we need async I/O for files. Writing should not be synchronous, but you should be able to find out about completion of each write.
Asynchrony is absolutely critical for performance.
Filesystem I/O, and, really, disk/SSD I/O is really very much the same as network I/O nowadays. You might be traversing a SAN, for example, or the seek latency on HDD could be reasonable for an HDD but nowadays that's just way too high anyways.
Transactional APIs are very difficult for filesystems. Barriers are enough for many apps. A barrier is also much easier to start using in existing apps. You'd call a system call to request a write barrier, and wait, preferably asynchronously, for completion notice (whereupon you'd know all writes done before the barrier must have reached stable storage).
- trentnelson 9y agoSo, basically, we need the NT-style, completion-oriented, inherently-asynchronous I/O model? ;-) (Amen!)
- davidgould 9y agoYou misspelled VMS as NT. And actually VMS borrowed the IO model from RSX-11. Async QIO style IO is all good clean fun, until someone writes something like: fml(...) { char buf[1024]; sys$qio(QIO_READ, buf, sizeof(buf)); return; } main() { fml(); do_stuff(); //surprise package delivered into stack here! }
- cryptonector 9y agoYes. Every system call that can block should take an event queue argument. If you want the system call to block then the C library's stub should wait for it for you.