Ordering::Release

If Acquire is the starting line of a lock, then Release is the finish line. In fact, the LLVM documentation says:

"Release is similar to Acquire, but with a barrier of the sort necessary to release a lock."

It's may be a little more subtle than lock might suggest, though. Here's what the Rust documentation has to say:

"When coupled with a store, all previous writes become visible to the other threads that perform a load with Acquire ordering on the same value."

Where Acquire stopped loads and stores after itself from migrating upward, Release stops loads and stores prior to itself from migrating downward, with regard to program order. Like Acquire, Release does not stop loads and stores prior to itself from migrating ...

Get Hands-On Concurrency with Rust now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.