#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

#394 in Concurrency

Download history 33/week @ 2024-06-24 28/week @ 2024-07-01 20/week @ 2024-07-29 2/week @ 2024-08-26 12/week @ 2024-09-09 27/week @ 2024-09-23 31/week @ 2024-09-30

70 downloads per month
Used in 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