esp-rs / esp-hal

no_std Hardware Abstraction Layers for ESP32 microcontrollers
https://docs.esp-rs.org/esp-hal/
Apache License 2.0
764 stars 214 forks source link

Add and use a dual-core optimized AtomicWaker implementation #2553

Open bugadani opened 6 days ago

bugadani commented 6 days ago

Registering and waking AtomicWakers should not use global critical sections. I propose creating a variant that uses Lock instead. Lock is word sized, so sharing a lock between AtomicWakers would not reduce the memory footprint, and would just cause more contention.