The Hidden Art of Thread-Safe Programming: Exploring java.util.concurrent
summary
Shows concrete concurrency failures and fixes: Vector’s serialization race then deadlock between nested V1↔V2 was fixed across Java 1.4→1.7; LongAdder (striped cells with @Contended) beats AtomicLong — 116ms vs 5s on 100M increments; LockSupport’s rare unpark loss needs class-initialization workarounds; LinkedBlockingQueue uses lock splitting so 1-producer/1-consumer wins but extra consumers slow it; ArrayBlockingQueue offers weakly consistent iteration via weak refs; CopyOnWriteArrayList does O(n) find‑then‑remove (check‑then‑act).
AI-written summary · about
chapters (10)
- 0:00Thread-safe programming intro
- 1:13Pitfalls of Vector class
- 6:15Java Memory Model rules
- 10:51JDK concurrent classes vs custom
- 14:04Demo: Striped64 and LongAdder
- 20:25Bugs in Java concurrent classes
- 22:50Thread-safe starting gun
- 27:28Lock splitting in LinkedBlockingQueue
- 34:11Weakly consistent queue iteration
- 36:58Conclusion & Q&A
related talks
50mThe Hidden Art of Thread-Safe Programming: Exploring java.util.con...
48mHandling concurrent access to shared resources in Java
47mA Deeper Dive into Java Concurrency Updates
41mEverything You Don’t Want to Know About Concurrency on the JVM
48mConcurrency: It’s Harder (and Easier) Than You Think
39mLet's talk concurrency
02h 17mJava's Concurrency Journey Continues! Exploring Structured Concurrency and Scoped Values
50mFlavors of Concurrency in Java
