The Rust's Arc
can be used from multiple threads and the count is safely
updated as needed. However, the Arc
itself can't be atomically replaced. To
do that, one needs to place it under a lock.
On the other hand, AtomicPtr
can be replaced atomically, but it's hard to
know when the target can be safely freed.
This is a cross-breed between the two ‒ an ArcSwap
can be seeded with an
Arc
and the Arc
can be simultaneously replaced and read by multiple
threads.
Read the documentation before using.
There's no hard policy yet. However, currently the crate builds with Rust 1.26 and is tested for that. There would have to be a very good reason to increase the required version.
Licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.