Concept
What one thread is guaranteed to see of another thread's writes: happens-before, volatile and safe publication.
The tutor works through these with you, in conversation and code. A session ends when you have shown them, not when a video does.
A few lines that show Java memory model doing its job.
class Worker implements Runnable {
private volatile boolean stopped; // without volatile the loop may never see the change
public void run() {
while (!stopped) { doWork(); }
}
public void stop() { stopped = true; }
}Using volatile for a compound action like check-then-act. volatile makes a single read or write visible; it does not make "if (!initialised) initialise()" atomic.
Your roadmap puts these before Java memory model, unless you already know them.
Once a session shows you understand Java memory model, it comes back for review. Each review takes a minute and tells the memory model how well you still know it.