News for hackers. Stuff that matters.
Re:How to think about `async`/`await` in Rust by mgaunard on Wednesday July 05, 2023 @04:54AM (#36597650)
That's not how an operating system models disk access though. You synchronously write to the kernel cache, and the kernel eventually gets those written to disk.

Wanting to do asynchronous I/O to disk is only useful if you're aiming to bypass the cache. In practice it is very hard to reach higher performance when doing that though.

Re:How to think about `async`/`await` in Rust by justin_ on Wednesday July 05, 2023 @05:19AM (#36597814)
I was referring to the fact that interaction with the disk itself is asynchronous. Indeed, the interface provided by a kernel for files is synchronous, and for most cases, that's what programmers probably want.

But I also think the interest in things like io_uring in Linux reflect that people are open to asynchronous file IO, since the kernel is doing asynchronous work internally. To be honest, I don't know much about io_uring though - I haven't used it for anything serious.

There's no perfect choice (as always) -- After all, for extremely high-performance scenarios, people avoid the async nature of IO entirely, and dedicate a thread to busy-looping and polling for readiness. That's what DPDK does for networking. And I think for io_uring and other Linux disk interfaces have options to use polling internally.

Re:How to think about `async`/`await` in Rust by mgaunard on Wednesday July 05, 2023 @05:37AM (#36597963)
Networking and disks are inherently entirely different.

Pretending they're the same under some generic I/O concept only goes so far.