IT lexicon › Programming › Happens-before relationship

Happens-before relationship

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

A formal rule defining which order memory operations are guaranteed to occur in when threads synchronize.

In concurrent programming, you need to know when writes from one thread become visible to others. "A happens-before B" means all operations before A are guaranteed visible before B is observed. It's not wall-clock time — a slower thread can run later but promise its data is ready before a faster thread reads it, via acquire-release semantics or barriers. Happens-before defines effective causality in memory visibility, not physical time.

← Back to the lexicon