#waker #no-alloc #async #object #data-structures #no-std

no-std wakerset

no_std, no_alloc storage of Wakers embedded in the Future type

2 releases

0.1.1 May 27, 2024
0.1.0 May 27, 2024

#626 in Concurrency


Used in 2 crates (via batch-channel)

MIT license

22KB
293 lines

no_std, zero allocation utility crate for efficiently storing sets of Wakers within the Future objects themselves.

Exposes a safe interface and passes MIRI.


lib.rs:

Asynchronous data structures like channels need to track sets of waiting futures. Holding them in a Vec requires allocation. We can do better by storing pending wakers in the futures themselves and linking them into an intrusive doubly-linked list.

This crate provides a no_std, no_alloc, safe Rust interface to the above strategy. The shared data structure holds a [WakerList] and each pending future holds a [WakerSlot], each of which holds room for one [Waker].

Dependencies

~69KB