Is the Acquire-Release Semantic Transitive?

This lesson introduces the concept of the acquire-release semantic being transitive.

We'll cover the following

The acquire-release semantic is transitive. That means if you have an acquire-release semantic between threads (a,b) and an acquire-release semantic between threads (b,c), you get an acquire-release semantic between (a,c).

Transitivity

A release operation synchronizes with an acquire operation on the same atomic variable and additionally establishes ordering constraint. These are the components to synchronize threads in a performant way if they act on the same atomic. How can that work if two threads share no atomic variable? We do not want any sequential consistency because that is too expensive, but we want the light-weight acquire-release semantic.

The answer to this question is straightforward. Applying the transitivity of the acquire-release semantic, we are able to synchronize threads that are independent.

In the following example, thread t2 with its work package deliveryBoy is the connection between two independent threads t1 and t3.

Get hands-on with 1400+ tech skills courses.