Tag

AtomicReference

1 views collected around this technical thread.

Full-Stack Internet Architecture
Full-Stack Internet Architecture
Jan 24, 2021 · Backend Development

Understanding and Using AtomicReference for Thread‑Safe Updates in Java

This article explains the limitations of volatile for compound updates, demonstrates non‑thread‑safe bank‑account examples, introduces synchronized locking, and then shows how AtomicReference with CAS operations provides a lock‑free, thread‑safe solution, including a deep dive into its internal implementation and related memory‑barrier concepts.

AtomicReferenceCASJava
0 likes · 14 min read
Understanding and Using AtomicReference for Thread‑Safe Updates in Java
Wukong Talks Architecture
Wukong Talks Architecture
Aug 25, 2020 · Backend Development

Understanding the ABA Problem in CAS and Solving It with AtomicStampedReference

This article explains the ABA issue that can occur in Java's compare‑and‑swap (CAS) operations, illustrates it with a building‑block analogy and concrete code examples, and shows how versioned atomic references such as AtomicStampedReference can reliably prevent the problem.

ABA problemAtomicReferenceAtomicStampedReference
0 likes · 11 min read
Understanding the ABA Problem in CAS and Solving It with AtomicStampedReference