arc-swap
Atomically swappable Arc
1.9.2
299M downloads/mo
#367 most downloaded on crates.io
vorner/arc-swap
What this package is like to depend on
Last release 1 months ago
28 Jun 2026
Ships unpredictably
gaps range from 2 weeks to 1.8 years
Nearly every release is documented
notes for 37 of 38 stable releases
8 versions withdrawn
withdrawn after publishing
8 years old
47 releases · first in 2018
6 releases in the last 12 months
see the full history below
Release timeline
47 releases · Apr 2018 to Jun 2026Releases
latest 47-
1.9.228 Jun 2026 -
1.9.104 Apr 2026 -
1.9.021 Mar 2026Release notes
Open source →- Promote certain orderings to SeqCst. Original proofs based on wrong reading of standard :-(. Expect some performance degradation (#198, #200).
-
1.8.214 Feb 2026Release notes
Open source →- Proper gate of
Pin(since 1.39 - we are not using onlyPin, but alsoPin::into_inner, #197).
- Proper gate of
-
1.8.102 Feb 2026 -
1.8.023 Dec 2025Release notes
Open source →- Support for Pin (#185, #183).
- Fix (hopefully) crash on ARM (#164).
- Fix Miri check (#186, #156).
- Fix support for Rust 1.31.0.
- Some minor clippy lints.
-
1.7.123 Mar 2024 -
1.7.003 Mar 2024Release notes
Open source →- Support building for no_std using nightly Rust compiler
-
Adds a new feature
experimental-thread-localthat enables building for no_std targets.
If this feature is not enabled, the crate is identical as before,
still allowing for compilation using Rust stable >= 1.38.0. -
The
experimental-thread-localfeature makes use of experimental featuresthread_local
andlazy_cell, thus requiring a nightly Rust compiler. -
Support for
std::sync::RwLockis dropped in no_std builds.
Release notes
Open source →- Support for no-std builds with the
experimental-thread-local. Needs nightly compiler. No stability guarantees with this feature (#93).
-
1.6.031 Dec 2022Release notes
Open source →- Fix a data race reported by MIRI.
- Avoid violating stacked borrows (AFAIK these are still experimental and not normative, but better safe than sorry). (#80).
- The
AccessConvertwrapper is needed less often in practice (#77).
-
1.5.130 Jul 2022Release notes
Open source →-
bug: Insufficient synchronization on weak platforms (#76).
Never observed in practice (it's suspected practical weak platforms like ARM are still stronger than the model), but still technically UB.
-
docs: Mention triomphe's
ThinArcaround the fat-pointer limitations.
-
-
1.5.015 Nov 2021 -
1.4.017 Sep 2021 -
1.3.227 Aug 2021Release notes
Open source →- More helpful description of the
AsRawtrait (isn't implemented for ownedArc/Option<Arc>).
- More helpful description of the
-
1.3.122 Aug 2021 -
1.3.023 May 2021Release notes
Open source →- Allow mapping of DynAccess.
- Fix some lints.
- Don't leave threads running in tests/doctests. It's a bad form and annoys miri.
-
1.2.003 Jan 2021Release notes
Open source →- Miri and 32 bit tests in CI.
- Making the writers lock-free. Soft-removing the IndependentStrategy, as it is no longer needed (hidden and the same as the DafultStrategy).
-
1.1.011 Dec 2020Release notes
Open source →- Fix soundness bug around access::Map. Technically a breaking change, but unlikely to bite and breaking seems to be the least bad option. #45.
-
1.0.015 Nov 2020 withdrawnRelease notes
Open source →- Remove Clone implementation. People are often confused by it and it is easy to emulate by hand in the rare case it is actually needed.
-
1.0.0-rc128 Oct 2020 pre-release withdrawnRelease notes
Open source →- Get rid of the
load_signal_safe. It only complicates things and it is niche; signal-hook-registry has its own simplified version. - Avoid
from_ptr(as_ptr()). Slight change inRefCnt::incwhich technically is API breaking change, but this one should not matter in practice. - Extend documentation about clone behaviour.
- Few more traits for Guard (
From<T: RefCnt>,Default). - Get rid of
rcu_unwap, the whole concept is a trap. - Hide the whole gen lock thing.
- Introduce the
Strategy, as a high level way to choose how exactly the locking happens.- Not possible to implement by downstream users just yet, or call them.
- The CaS is its own trait for flexibility.
- Adding the SimpleGenLock experimental strategy.
- Not part of stability guarantees.
- Get rid of the
-
0.4.811 Dec 2020Nothing published for this version
-
0.4.706 Jun 2020 withdrawnRelease notes
Open source →- Rename the
unstable-weaktoweakfeature. The support is now available on 1.45 (currently in beta).
- Rename the
-
0.4.621 Apr 2020 withdrawnRelease notes
Open source →- Adjust to
Weak::as_ptrfrom std (the weak pointer support, relying on unstable features). - Support running on miri (without some optimizations), so dependencies may run miri tests.
- Little optimization when waiting out the contention on write operations.
- Adjust to
-
0.4.518 Mar 2020 withdrawn -
0.4.417 Nov 2019 withdrawn -
0.4.321 Sep 2019 withdrawnRelease notes
Open source →- Fix the
Displayimplementation onGuardto correctly delegate to the underlyingDisplayimplementation.
- Fix the
-
0.4.210 Aug 2019 withdrawnRelease notes
Open source →- The Access functionality ‒ ability to pass a handle to subpart of held data to somewhere with the ability to update itself.
- Mapped cache can take
FnMutas well asFn.
-
0.4.105 Aug 2019 -
0.4.003 Aug 2019Release notes
Open source →- Support for Weak pointers.
- RefCnt implemented for Rc.
- Breaking: Big API cleanups.
- Peek is gone.
- Terminology of getting the data unified to
load. - There's only one kind of
Guardnow. - Guard derefs to the
Arc/Option<Arc>or similar. Cachegot moved to top level of the crate.- Several now unneeded semi-internal traits and trait methods got removed.
- Splitting benchmarks into a separate sub-crate.
- Minor documentation improvements.
-
0.4.0-pre.114 Jul 2019 pre-releaseNothing published for this version
-
0.3.1114 Apr 2019Release notes
Open source →- Prevention against UB due to dropping Guards and overflowing the guard counter (aborting instead, such problem is very degenerate anyway and wouldn't work in the first place).
-
0.3.1012 Apr 2019Release notes
Open source →- Tweak slot allocation to take smaller performance hit if some leases are held.
- Increase the number of lease slots per thread to 8.
- Added a cache for faster access by keeping an already loaded instance around.
-
0.3.905 Apr 2019Release notes
Open source →- Fix Send/Sync for Guard and Lease (they were broken in the safe but uncomfortable direction ‒ not implementing them even if they could).
-
0.3.827 Mar 2019Release notes
Open source →Lease<Option<_>>::unwrap(),expect()andinto_option()for convenient use.
-
0.3.726 Dec 2018 -
0.3.617 Nov 2018Release notes
Open source →- Another locking store (
PrivateSharded) to complement the global and private unsharded ones. - Comparison to other crates/approaches in the docs.
- Another locking store (
-
0.3.511 Nov 2018Release notes
Open source →- Updates to documentation, made it hopefully easier to digest.
- Added the ability to separate gen-locks of one ArcSwapAny from others.
- Some speed improvements by inlining.
- Simplified the
leasemethod internally, making it faster in optimistic cases.
-
0.3.421 Oct 2018Release notes
Open source →- Another potentially weak ordering discovered (with even less practical effect than the previous).
-
0.3.320 Oct 2018Release notes
Open source →- Increased potentially weak ordering (probably without any practical effect).
-
0.3.215 Oct 2018 -
0.3.113 Oct 2018Release notes
Open source →- Few convenience constructors.
- More tests (some randomized property testing).
-
0.3.023 Jul 2018Release notes
Open source →compare_and_swapno longer takes&Guardas current as that is a sure way to create a deadlock.- Introduced
Leasefor temporary storage, which doesn't suffer from contention likeload, but doesn't block writes likeGuard. The downside is it slows down with number of held by the current thread. compare_and_swapandrcuuses leases.- Made the
ArcSwapas small as the pointer itself, by making the shards/counters and generation ID global. This comes at a theoretical cost of more contention when different threads use different instances.
-
0.2.015 Jul 2018Release notes
Open source →- Added an
ArcSwapOption, which allows storing NULL values (as None) as well as a valid pointer. compare_and_swapaccepts borrowedArcascurrentand doesn't consume one ref count.- Sharding internal counters, to improve performance on read-mostly contented scenarios.
- Providing
peek_signal_safeas the only async signal safe method to use inside signal handlers. This removes the footgun with dropping theArcreturned fromloadinside a signal handler.
- Added an
-
0.1.403 Jul 2018Release notes
Open source →- The
peekmethod to use theArcinside without incrementing the reference count. - Some more (and hopefully better) benchmarks.
- The
-
0.1.325 Jun 2018 -
0.1.220 Jun 2018 -
0.1.119 Jun 2018 -
0.1.016 Apr 2018