Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Async embedded rust is fantastic. Absolutely nailed it once a couple more unstable features stabilize.

Also on cortex-m, you can put an executor on each cooperative priority but also you can put an executor on the main priority. That means you have one preemptive executor for blocking tasks and a couple cooperative choices.

I should add that I saw a huge reduction in RAM usage going to Embassy from Zephyr for a couple complicated applications. (on the order of 100KiB with all the stack and buffering reductions)



Can you give/point me to an example for how to do this (preemptive + cooperative combination)? What are the use cases? I’m new to embedded programming (and intermediate in Rust).


The main executor that you get when main is spawned is preemptive. You can do compression, math, etc there for as long as you like. You can spawn other executors from the main with assigned priorities. Using SWI executors for high priority cooperative scheduling can be great for timely handling of hardware peripherals. You slap an async Channel in between tasks that run on the same or different executors.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: