u/Frequent-Iron5492in r/rust • Recommends
On “Tokio async slow?”
This beautiful talk goes into the implementation of Tokio io async and shows, with code, that it is not really async. It ends up calling blocking read/write.
link to this video
4.7K subscribers • 4 videos on Hallway
Advanced. Deep dive for people who know the field.
6.8K views1 year ago2 recommendations
Systems programmingProgramming languagesRustOperating systemsConcurrency and parallelism
Vitaly Bragilevsky explores input-output operations across hardware devices, operating system calls, and Rust async runtimes like Tokio.
Many applications require as efficient input-output (I/O) as possible, including tasks such as reading from a disk or a network connection. However, I/O devices are known to be slow compared to CPUs and RAM. This contrast leads to various approaches for organizing I/O, ranging from step-by-step operations to enabling devices to write directly to main memory using Direct Memory Access (DMA). These methods correspond to different OS interfaces, from blocking I/O operations to highly asynchronous calls, and even emerging interfaces like io_uring, a new Linux kernel I/O interface. In this talk, we’ll explore I/O on three parallel levels: devices, operating system calls, and Rust code. It’s crucial to understand that software efficiency regarding I/O critically depends on the specific operations in use. Even more importantly, Rust code does not work in isolation—it relies on specific OS features and interfaces. Thus, we should learn about our Rust coding choices and their underlying implementations. There’s one more aspect: due to this dependency on OS interfaces, it’s impossible to implement a once-and-for-all solution that works across all operating systems at the most efficient level. However, by examining practical examples, we can discover some effective workarounds. Rust already enables us to write highly performant software. By deepening our understanding of I/O internals, we can make our code even more efficient! *About Vitaly Bragilevsky* I’m a developer advocate at JetBrains. I taught programming languages at universities for more than 20 years. I am the author of ‘Haskell in Depth’, published by Manning Publications in 2021, but I work with many other programming languages as well. -------------------- *EuroRust 2024* – the yearly 2 day conference for the European Rust community ➡️ eurorust.eu _EuroRust is organized by Mainmatter, experts in Rust and distributed systems_ ➡️ mainmatter.com/rust/What people say. Recommended for its deep dive into how Tokio async I/O works under the hood and its interaction with blocking OS calls.
u/Frequent-Iron5492in r/rust • Recommends
On “Tokio async slow?”
u/Right-Requirement328in r/rust • Recommends
On “Async File I/O use case?”