IT lexicon › Programming › Memory guarantee

Memory guarantee

Programming På svenska → Updated: 2026-11-15

A promise from the memory model about how operations from different threads become visible to each other.

A memory model is, at heart, a set of promises: "if you do X, then Y is guaranteed." A strong model (sequential consistency) says "all threads see the same order for all operations." A weaker model (relaxed) says only "it becomes consistent eventually." The Java memory model guarantees that reads of the same variable always see the most recent write—but only if you use the right keywords (volatile, synchronized, AtomicReference).

Memory guarantees are promises from languages and CPUs alike—and promises programmers must understand to avoid subtle bugs. A broken guarantee is often a rare race condition that only happens under load, only on certain processors, never in the debugger.

← Back to the lexicon