Async Rust and a High-level Overview of Tokio's Architecture

This post discusses asynchronous programming and different multitasking methods such as preemptive and cooperative. It explains the advantages of using asynchronous tasks instead of traditional threads to avoid memory saturation. It then explores how Rust makes writing asynchronous programs easy, using futures and compiler-generated state machines. Later on, it introduces Tokio, an asynchronous runtime for Rust, and explains task scheduling, managing run queues, and the role of the I/O driver in registering resources. Lastly, it introduces asynchronous interfaces for the Linux operating system and discusses io_uring and how it addresses previous shortcomings.

Those already familiar with Rust concepts may skip the Introduction and the first chapter.