IT lexicon › Programming › Safe publication

Safe publication

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

A guarantee that all mutations made by one thread become visible to other threads when an object is first accessed by another thread, provided proper publication mechanism is used.

Safe publication solves the problem where a thread constructs an object and then "publishes" it to other threads—by writing a reference to it in shared memory—without ensuring that all mutations within the object are actually visible to readers. With correct publication (typically through synchronization or volatile writes), readers are guaranteed to see a fully constructed object, not a partially initialized one or stale data.

It's a practical application of memory consistency rules and central to avoiding data races in real-world concurrent programs.

← Back to the lexicon