Skip to main content

Module waker

Module waker 

Source
Expand description

Zero-allocation waker using atomic priority bitmaps.

Each task has a (priority, index_in_priority) pair. When a waker fires, it atomically sets the corresponding bit in the per-priority queue and the global ready bitmap. The executor finds the next task in O(1) using leading_zeros on the bitmap.

Functions§

broadcast_reschedule
Kick every other hart so an executor idling in wfi/waiti on a different core notices new ready work. Exposed separately from wake_task so a caller waking several tasks in one batch (e.g. timer::poll_timers scanning every expired deadline inside one critical section) can broadcast once instead of once per task.
reset
Reset the waker state (for testing).
task_waker
Create a Waker for the task identified by id.
wake_task
Mark id ready and broadcast a reschedule request to every other hart.