Open
Description
@Amanieu's parking_lot crate has a SpinWait
module that implements exponential backoff. This would be a useful addition to the current implementation, and could also be exposed on its own. The latter might be useful when implementing other synchronization primitives that only need the spinning, and not the locking. There's been some discussion on this on the parking_lot issue tracker.
The biggest hurdle to adoption is that SpinWait
currently yields after spinning for a while, which wouldn't work with no_std
. As discussed on the parking_lot issue, this could be put behind a feature flag, or maybe even removed altogether and left to the users of the module.