Advertisement
Advertisement
β‘ Community Insights
Discussion Sentiment
33% Positive
Analyzed from 341 words in the discussion.
Trending Topics
#async#simply#tutorial#tokio#runtime#run#threads#cpu#locks#thread
Discussion Sentiment
Analyzed from 341 words in the discussion.
Trending Topics
Discussion (7 Comments)Read Original on HackerNews
There is actually already a tutorial at this level: Tokio has its βasync in depthβ tutorial [1] that walks you through building a toy runtime and using it to run a future.
Not a complaint β you can never have too many tutorials, unless they're about monads β but just a pointer in case you hadn't seen it :)
[1]: https://tokio.rs/tokio/tutorial/async
The rust flow is so much more natural to me.
If you hate garbage collection pauses (which most Rust users do) then don't use async.
> Whereas async simply locks the CPUWhereas async simply locks the CPU
This is also completely nonsense, context switching behavior is OS dependent and your average general purpose kernel is not cooperative. You will run for your allotted quanta or reschedule when you run out of coroutines that can execute without waiting for resources.