I need (Ref)UnwindSafe
ty, and Cell<bool>
doesn't provide it, so I'm using AtomicBool
instead.
Is it guaranteed that, in a single-threaded context, updates to one Rc<AtomicBool>
using Relaxed
(store) ordering are immediately visible on other Rc<AtomicBool>
s using Relaxed
(load) ordering? (The Rc
s point to the same AtomicBool
.)
Ordering
is about visibility guarantees in the presence of other threads. Memory accesses are always immediately visible within the current thread (barring noalias violations). So even the weakest ordering requirements (Relaxed
) are still at least as strong as normal accesses such as those provided by Cell
.