Locks? We Don't Need No Stinkin' Locks!
summary
Argues nonblocking concurrency is simpler and faster than locks and demonstrates it with CPU assembly, Java memory model rules, volatiles, Atomic classes, Unsafe and microbenchmarks. Shows Disruptor evolution: a failed spin-until-prev algorithm, a co-op pending-publications design, and a final ring-buffer publish-with-availability-array that removes write contention and scales. Reports volatile writes around ~8 ns uncontended, thread wakeups costing micro to millisecond ranges (4–16 µs up to 20–40 ms), and finds lazySet* and CAS are key practical tools.
AI-written summary · about
