Thread Safety with Phaser, StampedLock, and VarHandle
summary
Compares concrete concurrency tools and shows working code and measurements: replaces CyclicBarrier/CountDownLatch with phaser dynamic registration to deregister interrupted parties and keep meetings progressing, demonstrates fork/join cooperation via managed blockers, uses StampedLock optimistic reads to cut system CPU from roughly 17–25% down to near zero in a position/distance benchmark, and replaces locking with VarHandle CAS on a double[] to implement atomic moveBy with high throughput. Code is run live and the demos succeed with measured performance gains.
AI-written summary · about
chapters (14)
- 0:00Introduction
- 0:30Phaser
- 2:20Scrum Master
- 7:43Phaser Cancellation
- 13:05Who am I
- 15:05What is this
- 21:46The moveby
- 24:42The readwrite lock
- 31:55Exception prevention
- 34:18Range check
- 36:32VarHandle
- 38:18Position to VarHandle
- 40:38Campaign Set
- 43:54Questions
related talks
52mThread Safety with Phaser, StampedLock and VarHandle.
01h 14mThread Safety with Phaser, StampedLock and VarHandle
51mThread Safety with Phaser, StampedLock and VarHandle
47mUsing Java 8 Lambdas and Stampedlock to manage thread safety
45mThe Hidden Art of Thread-Safe Programming: Exploring java.util.concurrent
52mSTM and Structured Concurrency — The Battle with Multithreading Dragons
02h 17mJava's Concurrency Journey Continues! Exploring Structured Concurrency and Scoped Values
01h 06mLocks are tricky — let's understand them by building one
