#atomic #safe #pointers #box #swap #context #fork

atomicbox_nostd

Fork of the atomicbox library that works in no_std contexts

1 unstable release

0.3.1 Jul 19, 2020

#721 in Concurrency


Used in wrrm

MIT/Apache

23KB
365 lines

AtomicBox - Safe atomic boxes for Rust.

The Rust standard library provides atomic booleans, integers, and pointers. AtomicPtr is safe for loading, storing, and so forth; but pointers are unsafe to use.

It turns out that a safe atomic Box type is possible. Unfortunately, the only operation it supports is swap. Still, this is sufficient for some lock-free data structures, so here it is!

License

AtomicBox is distributed under the terms of both the MIT license and the Apache License (Version 2.0).

See LICENSE-APACHE and LICENSE-MIT, and COPYRIGHT for details.


lib.rs:

Safe atomic boxes.

The standard library provides atomic booleans, integers, and pointers. AtomicPtr is safe for loading, storing, and so forth; but pointers are unsafe to use.

It turns out that a safe atomic Box type is possible. Unfortunately, the only operation it supports is swap. Still, this is sufficient for some lock-free data structures, so here it is!

No runtime deps