Re:Show HN: Whirlwind – Async concurrent hashmap for Rust
by binarycoffee on Tuesday November 05, 2024 @07:23PM
(#42056410)
The producers of an MPSC queue may use an AtomicWaker::wake to signal to the consumer that a new item is ready. In this case all wake-ups are necessary (not spurious).
In the common case, the waker side will operate some logic like:
and the future will run: Thus, even if `register` decides to “spin”, the flag will already be set, and so the future will not spin in reality (it may be polled unnecessarily, but this will only happen once).I can’t immediately think of examples where support for spurious waking is necessary.