Compare-and-swap at the x86/ARM hardware level, AtomicInteger/Long/Reference, the compareAndSet loop pattern, the ABA problem and AtomicStampedReference as the fix, LongAdder's striped cells under high contention, VarHandle (Java 9) replacing Unsafe, and implementing a lock-free stack and queue from scratch.
// Lessons
- 01soon
The Hardware Instruction — Compare-and-Swap at the CPU Level
- 02soon
AtomicInteger and AtomicLong — The Java CAS Wrappers
- 03soon
AtomicReference — CAS for Object References
- 04soon
The compareAndSet() Loop Pattern — Lock-Free Counter from Scratch
- 05soon
The ABA Problem — Why CAS Is Not Always Enough
- 06soon
AtomicStampedReference and AtomicMarkableReference — ABA Countermeasures
- 07soon
LongAdder and LongAccumulator — Striped Cells Under Contention
- 08soon
VarHandle (Java 9) — The Unsafe Replacement
- 09soon
Lock-Free Stack — A Real Implementation with CAS
- 10soon
Lock-Free Queue — The Michael-Scott Queue Explained