A practical approach to Java Memory Model
summary
Explains concrete JMM failures reproduced with JCStress tests: store/load reorderings produce unexpected outcomes like "0 0" and "1 1" on x86, a forbidden "3" result appearing tens of thousands of times due to wrong volatile/order use, and visibility bugs on ARMv7 (Raspberry Pi) until fields are marked final to trigger the final freeze action. Shows fixes that work: disable JIT inlining with -XX:-Inline, set CPU affinity to remove cross-core store buffering effects, and correct volatile/ordering or make fields final.
AI-written summary · about
chapters (16)
- 0:00Start
- 0:37About Me
- 1:07Out of Order Execution
- 2:08Compiler Optimization
- 3:15Loop Unrolling
- 3:55Example of Multi Thread Execution
- 5:47Compile Optimization
- 8:28Load and Store Buffers
- 11:25Jc Stress Framework
- 13:27Termination
- 15:44How the Framework Works
- 17:18Threads on the Same Cpu
- 21:02Thread Safe Immutable Objects
- 24:36Thread Size Mutable Objects
- 32:12Reflection
- 32:51Volatiles
related talks
45mJava Memory Consistency Model
36mConcurrency — Java Memory Model — Not Just for Eagles
22mJava Memory Model
58mClose Encounters of the JMM Kind
01h 20mWorkshop: Java Concurrency Stress (JCStress). Part 1
41mJava Memory Consistency Model
01h 11mProgramming language memory models: Problems, solutions, and directions
02h 01mWorkshop: Java Concurrency Stress (JCStress). Part 2
