~/talk

Thread Safety with Phaser, StampedLock and VarHandle

Talkat Joker 2020 · 2020-11-25..11-28· [concurrency, java]
slides:none on file

Live demos compare wait/notify, ReentrantLock+Condition, CountDownLatch, volatile spin and Phaser (arriveAndAwaitAdvance) for synchronized starts and show phaser wins (single-digit microsecond max spread, total ~8Mns across runs), volatile spin is second best, wait/notify and countdown perform worse. StampedLock optimistic reads give ~30x improvement over naive locking for a position update workload using its StampedLock optimistic read idiom. VarHandle field-replacement with VarHandle CAS matches Unsafe speeds once warmed. Phaser party limit is 65k but can be tiered into a tree.

AI-written summary · about

  1. 0:00Introduction and speakers
  2. 2:39About the speakers
  3. 5:29Code joining approaches overview
  4. 10:44Demo wait notify approach
  5. 19:33Demo reentrant lock approach
  6. 23:02Demo countdown latch approach
  7. 26:10Demo volatile spin approach
  8. 28:00Demo phaser approach
  9. 38:17StampedLock introduction
  10. 48:49Crocodile synchronization demo
  11. 54:03Demo reentrant lock vs synchronized
  12. 57:37Demo reentrant read-write lock
  13. 59:00Demo StampedLock approach
  14. 1:05:15VarHandle introduction
  15. 1:07:03Demo VarHandle approach
  16. 1:12:06Closing and Q&A
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.