BLOG: Why choose async/await over threads? (
from to on 25 Mar 14:58


threaded - newest on 25 Mar 16:51 collapse

Finally some positivity around async Rust!

I write a lot of embedded C for a living, and can’t wait for the ecosystem to get better so I can switch to Rust. Threading always starts simple. All I need is to spawn a thread and wait for a message on a queue. Then requirements change and I’m waiting on multiple messages from multiple other threads and suddenly I’m writing yet another state machine that async Rust would write for me.

I also wish I had “coloured” functions in my embedded code. Often times it’s not even documented if a function blocks or not, and sometimes the behaviour changes depending on compile time configuration (blocking, or interrupt driven, or DMA, etc.).

Async Rust certainly has it’s complexity too, but at least to my brain it would make a lot of my code much simpler.

I need to find some time to really dig into Embassy one of these days. on 25 Mar 21:19 collapse

I’m looking at Embassy too for a Pico project and combining it with a nostd mqtt implementation. However I need to understand Futures and if/how they relate to the async paradigm. on 27 Mar 02:23 collapse

Sounds fun! I assume you’re read the Async Book? on 27 Mar 06:18 collapse

I have not, but I will now thanks.