Who Runs Your Rust Future? Hands-On Intro to Async Rust
1–10 of 40 posts
Re: Who Runs Your Rust Future? Hands-On Intro to Async Rust
#2Re: Who Runs Your Rust Future? Hands-On Intro to Async Rust
#3Re: Who Runs Your Rust Future? Hands-On Intro to Async Rust
#4There 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 :)
Re: Who Runs Your Rust Future? Hands-On Intro to Async Rust
#5Re: Who Runs Your Rust Future? Hands-On Intro to Async Rust
#6The rust flow is so much more natural to me.
Re: Who Runs Your Rust Future? Hands-On Intro to Async Rust
#7Re: Who Runs Your Rust Future? Hands-On Intro to Async Rust
#8If you hate garbage collection pauses (which most Rust users do) then don't use async.
Re: Who Runs Your Rust Future? Hands-On Intro to Async Rust
#9Don't use async but use threads instead. Threading treats the CPU as a resource, which it is! Whereas async simply locks the CPU, which can deplete the system for longer computations. 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.
Re: Who Runs Your Rust Future? Hands-On Intro to Async Rust
#10Don't use async but use threads instead. Threading treats the CPU as a resource, which it is! Whereas async simply locks the CPU, which can deplete the system for longer computations. If you hate garbage collection pauses (which most Rust users do) then don't use async.