Concurrency — Java Memory Model — Not Just for Eagles
summary
The talk demonstrates Java memory-model failures using jcstress: showing a rare 1,0 read, a common 1,0/0,1 causality break, and a frequent 0,0 consensus anomaly, and notes that results change between Java 11 and 17. It shows that debugger/logging affect outcomes, that adding synchronized only to the writer does not fix it, and that correct fixes are publishing via volatile, proper monitor handoff, using thread start/join, or full synchronization so readers see the writer’s writes.
AI-written summary · about
chapters (9)
- 0:00Java Memory Model intro
- 4:42Thread synchronization
- 8:40Sync problems in practice
- 12:41Shared memory properties
- 17:37JMM spec vs implementation
- 22:13JMM guarantees
- 26:45Sync via volatile
- 30:40Safe object construction
- 33:47Summary
related talks
01h 20mWorkshop: Java Concurrency Stress (JCStress). Part 1
40mA practical approach to Java Memory Model
45mJava Memory Consistency Model
02h 01mWorkshop: Java Concurrency Stress (JCStress). Part 2
22mJava Memory Model
49mUnconventional memory model extensions in practice
30mJCStress: Diving into Concurrency and Distributed Systems in Java
58mClose Encounters of the JMM Kind
