Skip to content
0:00 / 0:00

#tokio#asyncrust#futures

Decrusting the tokio crate

Jon Gjengset

111K subscribers • 38 videos on Hallway

YouTube
  • Recommended by 5 people: 5 in engineering communities.
  • Presented by Jon Gjengset
  • Linked in the descriptiontokio-rs/tokio

Advanced. Deep dive for people who know the field.

196K views2 years ago5 recommendations

Systems programmingProgramming languagesRustConcurrency and parallelismNetworking and protocols

Jon Gjengset explores the internals of the Tokio crate, covering its runtime, blocking tasks, synchronization, and cancellation.

In this stream, we peeled back the crust on the tokio crate — 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 docs.rs/tokio/. Discord: discord.jonhoo.eu Introduction The parts of tokio The tokio runtime Blocking Send bounds and LocalSet tokio vs std Mutex Runtime questions tokio resources tokio::fs nuances tokio::process nuances tokio::io things tokio-stream tokio::sync tokio::task::JoinSet tokio::select! and cancellation tokio-util and CancellationToken common errors: tokio::spawn common errors: concurrency vs parallelism common errors: mpsc fan-in Follow-up questions and outro Live version with chat: youtube.com/live/YlTyZvpaywQ

Why it's here

5 people recommend this

What people say. Highly recommended as an in-depth guide to understanding how Tokio and async Rust work under the hood.

Moments people linked to

u/redixhumayunin r/rust • Recommends

On “Understand Async Rust”

Love Jon’s videos I’d also add his more recent video on Tokio ->link to this video

u/Narduwin r/rust • Recommends

On “How do you decide to use async or single/multithreading?”

Decrusting Tokio link to this video

u/kruvasyanin r/rust • Recommends

On “what are some good resources to learn about Futures in depth?”

Jon Gjengset has a great YouTube video about Futures: [video Also you can find on his channel how tokio crate works: [video

u/RoXyyChanin r/rust • Recommends

On “Advanced async resources ”

One of the best videos i ever watched on async rust and tokio link to this video

u/Limp-Sherbetin r/rust • Recommends

On “Is my code garbage?(Struggled 8 hours in one sitting with trial and error)”

I would suggest taking a look into tokio, it can be pretty hard to grasp sometimes but I think it would great for your project You can also check out Jon Gjengset, he has pretty informative videos on a lot of Rust related concepts Before using tokio, you should get comfortable with futures, that helped me a lot tokio crate futures

u/1vaderin r/rust • Mentions

On “Combatting over-reliance on `mpsc` channels”

You linked the wrong timestamp. The relevant part is a few minutes later: [video And there are lots of things wrong with this benchmark. For one, you're waiting for all your producers to finish before even starting your consumer. This among other things means that the mutex consumer finishes the whole batch on the first iteration and then uselessly locks and unlocks the mutex 100\_000 times. It also means that you including the time to add to the queue in your benchmark. In the scenario Jon described, the consumer and producers are running concurrently and the consumer is the bottleneck, so only the time it takes is really relevant (assuming that the different method of sending doesn't…
24View on Reddit