Description
Hi! I'm working on a Future
s executor for no_std
environments and was looking for a lock-free queue when I found crossbeam-deque
, which is unfortunately not no_std
.
It seems to me that it's possible to add variants of all of the methods that call epoch::pin
and epoch::is_pinned
functions which instead take an explicit &LocalHandle
argument to do the pinning. The original methods could then use the no_std
variants under the hood via the crossbeam_epoch::with_handle
function. The only other thing I see that has an std
requirement is Backoff::snooze
which calls thread::yield_now
. Maybe its body could just call spin
if compiled without std
?
I've got this pretty much all implemented locally and would be happy to clean it up and submit a PR, but I have some API/documentation questions.
- Would it be better to have separate types for
std
/no_std
environments or to have them unified and instead use*_with_handle
methods next to the original ones? - Duplicating all of these methods for
std
/no_std
could also mean duplicating documentation. Would it instead be better to simply link to theno_std
methods from theirstd
counterparts so that we wouldn't have two places to update descriptions/examples?