Expand description
Arc based Rcu implementation originally implementated in mthom/scryer-prolog#1980
A r c
R c u
A r c uThe atomics based version performs lock-free1 reads. By using Arc we keep the read-critical-section short and free of user defined code and automatically perform cleanup when no reference remains.
To coordinate reads and writes EpochCounters from an EpochCounterPool are used.
Each read used an EpochCounter from the EpochCounterPool of the Arcu incrementing it once before entering the RCS and once more on leaving the RCS.
Each write checks against all EpochCounters in the pool, blocking until it is safe to decrement the strong count of the Arc that was replaced by the write.
when using thread local epoch counter with the global epoch counter pool, the initial read may block while adding the threads epoch counter to the pool ↩
Modules§
- atomic
- Thi module contains the atomic and Arc based Rcu
- epoch_
counters - This module contains
EpochCounter,EpochCounterPooland related functionality. - rcu_ref
- This module contains the
RcuReftype which is a smart pointer to the content of ansuper::Rcu - rwlock
- This module contains the RwLock and Arc based Rcu
Traits§
- Rcu
- An abstract Rcu to abstract over the atomic based
atomic::Arcuand the RwLock basedrwlock::Arcu