Nonblocking algorithms/ CAS/Atomics
summary
Shows how to build real lock-free primitives in Java using compare-and-swap via Unsafe and Atomic classes, including a lock-free counter and a replace-the-range object implemented with AtomicLongFieldUpdater (and reflection to get offsets). Demonstrates microbenchmarks where CAS compiled to a single CPU instruction yields up to ~80x advantage under contention, explains GC/allocation cost when creating new objects per update, and spells out progress guarantees (obstruction/wait/free) and the Amdahl tradeoffs.
AI-written summary · about
chapters (9)
- 0:00Introduction
- 6:48Locking problems in multithreading
- 13:48Amdahl's law and performance
- 20:15CAS and atomic operations
- 27:47Java Atomic API examples
- 36:43Optimizing with nonblocking algorithms
- 41:04Atomic counters demo
- 47:24Nonblocking vs lock-free algorithms
- 49:08Study recommendations
related talks
01h 12mThe speed of concurrency (is lock-free faster?)
50mThe Hidden Art of Thread-Safe Programming: Exploring java.util.con...
47mUsing Java 8 Lambdas and Stampedlock to manage thread safety
01h 08mDesigning fast lock free algorithms by understanding cache coherence dynamics
01h 03mA lock-free atomic shared_ptr
01h 30mLive Lock-Free or Deadlock (Practical Lock-free Programming)
01h 28mA lock-free std::atomic std::shared_ptr
01h 03mSafety: off --- How not to shoot yourself in the foot with C++ atomics
