atomic-ext 0.3.0

Extensions for atomic operations.
Documentation
atomic-ext-0.3.0 has been yanked.

Atomic extensions

docs

AtomicArc

AtomicArc is a lightweight atomic pointer to Arc.

The implementation is based on "split reference counting", which has similar performance with Arc.

Example

use std::sync::{atomic::Ordering, Arc},

use atomic_ext::AtomicArc;

let a = Arc::new(1);
let b = Arc::new(2);
let x = AtomicArc::new(a);
let c = x.load(Ordering::Acquire);
assert_eq!(c, a);
let c = x.swap(b, Ordering::AcqRel);
assert_eq!(c, a);
let c = x.load(Ordering::Acquire);
assert_eq!(c, b);