3 ms·
> Async Rust (by default) can allocate memory For bare-metal Rust firmware, you would always use no-std, which excludes a default allocator. I understand from
by sshine 2y ago
> Async Rust (by default) can allocate memory
For bare-metal Rust firmware, you would always use no-std, which excludes a default allocator.
I understand from what you're saying that the principal difference between embassy-rs and what you'd expect from an RTOS is the choice of scheduling; as far as I can see, embassy-rs'es cooperative scheduler is even defended as highly intended.
The advantage of cooperative scheduling is that you don't need threads and context switching, since every yield gives control to the next task. And, as you say, the downside is that you can't reason about when yielding happens, so you can only hope that tasks yield often.
> interrupt executor [...] essentially ties each task to a dedicated interrupt, and AFAICT requires that all high-priority work must happen in interrupt context.
Hmm, that seems bad.
And how so is RTIC disqualified? It seems not classically preemptive.
https://rtic.rs/2/book/en/#rtic---the-past-current-and-future https://rtic.rs/2/book/en/#rtic---the-past-current-and-futur...
https://interrupt.memfault.com/blog/embedded-async-rust#cooperative-vs-preemptive-scheduling https://interrupt.memfault.com/blog/embedded-async-rust#coop...
https://tweedegolf.nl/en/blog/65/async-rust-vs-rtos-showdown https://tweedegolf.nl/en/blog/65/async-rust-vs-rtos-showdown