thepointman.dev_

Courses / Java Concurrency

Java Memory Model

advanced10 lessons

From CPU caches and reordering to the formal JMM (JSR-133). The happens-before relation's five rules, memory barriers, the double-checked locking bug explained precisely (not hand-waved), safe publication idioms, and final field semantics — the one free publication mechanism.

// Lessons

  1. 01

    CPUs, Caches and Registers — Why Shared Memory Is Complicated

    soon
  2. 02

    Memory Reordering — Compiler and CPU Reorder Differently

    soon
  3. 03

    Memory Barriers — The Hardware Instruction That Prevents Reordering

    soon
  4. 04

    The Java Memory Model — What JMM Actually Specifies (JSR-133)

    soon
  5. 05

    happens-before — The Program Order Rule

    soon
  6. 06

    happens-before — Monitor Lock and Volatile Variable Rules

    soon
  7. 07

    happens-before — Thread Start, Join and Interrupt Rules

    soon
  8. 08

    The Double-Checked Locking Bug — A Missing Volatile Barrier

    soon
  9. 09

    Safe Publication — How to Share Objects Across Threads Correctly

    soon
  10. 10

    Final Field Semantics — The One Free Publication Mechanism

    soon