We break down the rules of visibility and operation ordering in the Java Memory Model: what the
happens-before relation means, how and when
volatile,
synchronized, and final fields (
final) help, and why “stale” data appears without them. We will show safe publication of objects, correct
double-checked locking, low-level access via
VarHandle, the impact of false sharing and the
@Contended annotation, as well as practical notes about
Thread.start()/
Thread.join(),
Future.get(), and
JMH microbenchmarks.