pub struct AtomicBitSlice<A, V>(/* private fields */);Expand description
Unsized shared base for multi-word atomic bitset types.
AtomicBitSlice<A, V> is to atomic bitsets what BitSlice<T, V>
is to non-atomic ones: a #[repr(transparent)] wrapper around [A] that provides
common query and mutation methods. Owned types (AtomicBitSet<[A; N], V>
and AtomicBoxedBitSet<A, V>) implement
Deref<Target = AtomicBitSlice<A, V>>.
§Atomicity guarantees
Each individual method (insert, remove, contains, …) performs atomic
operations per word. However, the bitset as a whole is not a single
atomic unit when it spans multiple words. Concurrent modifications to bits
within the same word are correctly synchronized via fetch_or / fetch_and
with AcqRel ordering. Modifications to bits in different words are
independent atomic operations — there is no cross-word transactional guarantee.
Read-only methods (len, iter, contains, is_subset, …) load each word
with Relaxed ordering and do not take a consistent snapshot of the entire
bitset. If another thread modifies the set concurrently, these methods may
observe a mix of old and new state across different words.