Decrusting the tokio crate
In this stream, we peeled back the crust on the tokio crate — https://github.com/tokio-rs/tokio/ — and explored its interface, structure, and mechanisms. We talked about blocking, cancellation, spawning, and mechanisms for synchronization. We also dug into some of what goes on under the hood where that ends up being relevant to you as an application author!
For more details about tokio, see https://docs.rs/tokio/.
Discord: https://discord.jonhoo.eu
0:00:00 Introduction
0:02:28 The parts of tokio
0:05:19 The tokio runtime
0:29:08 Blocking
0:48:09 Send bounds and LocalSet
0:51:04 tokio vs std Mutex
0:56:53 Runtime questions
1:06:00 tokio resources
1:28:19 tokio::fs nuances
1:33:47 tokio::process nuances
1:36:27 tokio::io things
1:47:30 tokio-stream
1:56:13 tokio::sync
2:11:10 tokio::task::JoinSet
2:19:13 tokio::select! and cancellation
2:51:26 tokio-util and CancellationToken
3:03:35 common errors: tokio::spawn
3:07:25 common errors: concurrency vs parallelism
3:08:53 common errors: mpsc fan-in
3:12:08 Follow-up questions and outro
Live version with chat: https://youtube.com/live/YlTyZvpaywQ
Other Videos By Jon Gjengset
2025-08-01 | Vibe coding complex changes in Rust |
2025-05-30 | Explaining assembly by playing SHENZHEN I/O |
2025-03-10 | Porting the guff plot device to Rust |
2025-01-02 | January 2025 Q&A |
2024-09-21 | Decrusting the quickcheck crate |
2024-08-25 | Implementing a Lox interpreter in Rust |
2024-07-14 | Open Source Maintenance, 2024-07-14 |
2024-05-18 | What's New in Rust 1.72-1.78 Rustacean Station marathon |
2024-05-04 | Q&A May 2024 |
2024-04-05 | Decrusting the tokio crate |
2024-03-09 | Implementing (parts of) git from scratch in Rust |
2024-02-09 | Decrusting the tracing crate |
2024-02-06 | Jon Gjengset Live Stream |
2024-01-14 | Hardware and software [2024 edition] |
2023-12-16 | Q&A December 2023 |
2023-12-15 | Q&A Session |
2023-11-17 | Making the (partial) Rust BitTorrent client more reasonable |
2023-10-19 | Implementing (part of) a BitTorrent client in Rust |
2023-08-26 | Open Source Maintenance, 2023-08-25 |
2023-08-13 | Open Source Maintenance, 2023-08-13 |
2023-08-06 | Open Source Maintenance, 2023-08-06 |