Tag

lock prefix

0 views collected around this technical thread.

Selected Java Interview Questions
Selected Java Interview Questions
Jul 31, 2021 · Fundamentals

Understanding Java volatile, Memory Semantics, and the lock Prefix

This article explains the two core properties of Java's volatile keyword—visibility and ordering—how they are implemented via lock prefixes and memory barriers, compares volatile with synchronized and CAS, and details the underlying CPU cache‑coherency mechanisms such as MESI, store buffers, and invalidate queues.

ConcurrencyHappens-BeforeMESI
0 likes · 13 min read
Understanding Java volatile, Memory Semantics, and the lock Prefix