Post B6SgFY3GMqvhewSAee by Aissen@social.treehouse.systems
(DIR) More posts by Aissen@social.treehouse.systems
(DIR) Post #B6SgFPvsYQGmTiwA2C by Aissen@social.treehouse.systems
0 likes, 0 repeats
For the final talk of the day, Alice Ryhl will talk about Completion-based IO.#RustWeek #RustWeek2026
(DIR) Post #B6SgFQ6VusmD0huebw by Aissen@social.treehouse.systems
0 likes, 0 repeats
This talk is about the old decisions that come haunting you much later when you can't change the API. And it's not about Pin.#RustWeek
(DIR) Post #B6SgFQKL5TprhaNhA0 by Aissen@social.treehouse.systems
0 likes, 0 repeats
Readiness-based IO is the old model, while completion-based IO is the new one. In the latter, more work is moved into the OS.The AsyncRead and AsyncWrite are readiness-based. Even though completion-based IO could be implemented on top of it, it's a leaky abstraction.#RustWeek
(DIR) Post #B6SgFQWkLLlCK4BbV2 by Aissen@social.treehouse.systems
0 likes, 1 repeats
Why would supporting completion-based model be important? Because the world is moving towards completion-based IO models (in red).io_uring appeared in 2019, providing a more performant model.It was soon cloned by Windows. Even WASI is moving towards this model, while being platform-agnostic.#RustWeek
(DIR) Post #B6SgFY3GMqvhewSAee by Aissen@social.treehouse.systems
0 likes, 0 repeats
The tokio documentation recommends against using tokio for reading a lot of files.But this is obsolete, Alice says, becuase now in tokio, File IO will use io_uring transparently.#RustWeek #RustWeek2026 #iouring #tokio #RustLang #io_uring
(DIR) Post #B6SgFarJvi9wMltAxM by Aissen@social.treehouse.systems
0 likes, 0 repeats
But completion-based IO has other advantages. It also provides Buffer pools, allowing to offload and batch more things to the OS. And it helps reducing memory consumption.#RustWeek
(DIR) Post #B6SgFhGM7XkaE9eFoO by Aissen@social.treehouse.systems
0 likes, 0 repeats
One approach to move to completion-based IOs is to use the same traits, but still have an extra copy.Another would be to add compatibility at higher layer, for example the HTTP Framework, or in Stream<Item = Bytes>.Continuing to use readiness-based IO is also still an option. And io_uring can also to readiness-based IO with IORING_OP_POLL_ADD.And finally, Alice says "we have to do both" which enables gradual adoption of completion-based IO models.#RustWeek
(DIR) Post #B6SgFoicOrW7LpvQKu by Aissen@social.treehouse.systems
0 likes, 0 repeats
And that's it for today! I'm off to drinks and social activities, to be continued tomorrow!#RustWeek