2 releases
0.1.1 | May 27, 2024 |
---|---|
0.1.0 | May 27, 2024 |
#430 in Concurrency
103 downloads per month
Used in 2 crates
(via batch-channel)
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