Common utilities for lock-free and concurrent programming.
This crate provides fine-grained control over its contents through cargo feature flags:
conquer-utils enables the
std feature, which links against
the standard library and requires e.g. OS support.
Disabling this feature allows this crate to be used in
If the targeted environment does not allow using
std features but provides
the means for dynamic memory allocation, the
alloc feature can be used to
enable additional functionality.
Note that the
std feature implicitly activates all
alloc features as
The following utilities are provided when compiling this crate with the appropriate feature flags:
align feature is enabled, the same-named module can be used,
which provides generic thin wrapper types for specifying the alignment for
instances of the respective type.
Particularly useful is the
type, which forces an alignment to the size of a cache-line.
This helps to avoid false sharing.
The provided types can be used in their entirety in a
By enabling the
back-off feature, this crate provides the
BackOff type, which can be used to perform exponential
back-off in e.g. spin-loops.
This type is
#![no_std] compatible, but provides additional features when
std feature is also enabled.
random feature in addition to the
back-off feature pulls in
rand dependency and additionally adds
randomized exponential back-off, which adds some slight variations the time
each thread spends spinning.
This may help avoid issues such as convoying.
tls feature makes the
BoundedThreadLocal available, which is useful
for iterable per-object thread local storage for bounded numbers of threads.
Transparent thin wrapper types for artificially increasing the alignment of the wrapped type.
A type for exponential back-off in tight loops.
A lock-free bounded per-value thread local storage.
An Error for signalling than more than the specified maximum number of
threads attempted to access a
An owning iterator that can be created from an owned
A iterator that can be created from an unique reference to a
A wrapper for an instance of
A thread local token granting unique access to an instance of