Struct constellation::bitset::AtomicBitSet [] [src]

pub struct AtomicBitSet { /* fields omitted */ }

This is similar to a BitSet but allows setting of value without unique ownership of the structure

An AtomicBitSet has the ability to add an item to the set without unique ownership (given that the set is big enough). Removing elements does require unique ownership as an effect of the hierarchy it holds. Worst case multiple writers set the same bit twice (but only is told they set it).

It is possible to atomically remove from the set, but not at the same time as atomically adding. This is because there is no way to know if layer 1-3 would be left in a consistent state if they are being cleared and set at the same time.

AtromicBitSet resolves this race by disallowing atomic clearing of bits.

Methods

impl AtomicBitSet
[src]

Creates an empty BitSet.

Adds id to the AtomicBitSet. Returns true if the value was already in the set.

Because we cannot safely extend an AtomicBitSet without unique ownership this will panic if the Index is out of range

Adds id to the BitSet. Returns true if the value was already in the set.

Removes id from the set, returns true if the value was removed, and false if the value was not set to begin with.

Returns true if id is in the set.

Clear all bits in the set

Trait Implementations

impl BitSetLike for AtomicBitSet
[src]

Return a usize where each bit represents if any word in layer2 has been set. Read more

Return the usize from the array of usizes that indicates if any bit has been set in layer1 Read more

Return the usize from the array of usizes that indicates if any bit has been set in layer0 Read more

Return a usize that maps to the direct 1:1 association with each index of the set Read more

Create an iterator that will scan over the keyspace