liveBook · Manning

Release operation

As explained in Modern C, Third Edition

A release operation is a synchronization operation that makes preceding effects available to a corresponding acquire operation.

A release operation publishes preceding effects so that a corresponding acquire operation can observe them. C synchronization functions commonly work in release–acquire pairs. section 21.2

One-time initialization

The first call to call_once(&obj, g) acts as a release operation; later calls using the same object act as acquire operations. Writes performed by g(), such as computing a file name and opening a stream, are therefore visible when those later calls return. section 21.2

Common release–acquire pairs include:

  • thrd_create and entry to the created function; thread return or thrd_exit and the corresponding join-related synchronization. section 21.2

How Modern C, Third Edition covers it

How deep it goes
Defines publication through synchronization and works through call_once, while deferring detailed mutex behavior.
Examples
Uses call_once initialization, thread creation and joining, thread termination, and mutex release–acquisition pairs.
What it assumes
Assumes familiarity with threads and library synchronization while defining release–acquire pairing through concrete operations.
What you can do after
Evaluate which preceding effects become visible after a corresponding C synchronization operation.
How it connects
Connects synchronization, acquire operations, threads, call_once, mutexes, and memory visibility.

Also explained in

Compare how 2 books explain release operation →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Modern C, Third Edition. The section links point to the parts of the book it draws on.