IT lexicon › Programming › Thread visibility

Thread visibility

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

The property that changes made by one thread become visible to other threads, guaranteed through happens-before relations and synchronization primitives.

Thread visibility concerns when and how changes to shared variables become visible across threads. Without it, one thread's read could return a stale value from CPU cache even if another thread wrote a new value. Visibility is guaranteed through happens-before relations — when a thread acquires a lock or writes to a volatile variable, all prior writes are guaranteed visible to the next thread that reads the same data.

This is one of the most critical problems in concurrent programming. Without proper synchronization, even simple read-write patterns produce unexpected results. Java and C++ memory models have explicit rules governing this behavior.

← Back to the lexicon