IT lexicon › Programming › Release fence

Release fence

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

A memory barrier that forces all prior loads and stores to complete before instructions after this point begin.

A release fence is an explicit instruction telling the processor: "all my changes so far must be visible to others before the next instruction." It's weaker than a full fence (which also prevents later operations from moving before the barrier) but stronger than no guarantee. Release fences create synchronizes-with relations: one thread's release fence synchronizes-with another thread's acquire fence.

In C++, this is `std::atomic_thread_fence(memory_order_release)`. It's an explicit instruction on ARM and PowerPC but often a no-op on x86, where the processor already guarantees release behavior.

← Back to the lexicon