Skip to content
forked from vorner/arc-swap

Support atomic operations on Arc itself

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

zyctree/arc-swap

 
 

Repository files navigation

ArcSwap

Travis Build Status AppVeyor Build status

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.

Rust version policy

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.

License

Licensed under either of

at your option.

Contribution

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.

About

Support atomic operations on Arc itself

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Rust 100.0%