Relaxed Memory Model Zoo

Release-Acquire (C/C++11 RA fragment)
← Back to the map

Release-Acquire (C/C++11 RA fragment)

2011 · Batty, Owens, Sarkar, Sewell, Weber · language, formal · axiomatic formalism

The release-acquire fragment of the C/C++11 model: release stores, acquire loads and acquire-release RMWs, with no relaxed, non-atomic or seq_cst accesses. Lahav & Boker (Table 1) axiomatise it as irreflexivity of hb, write-coherence (mo;hb irreflexive), read-coherence (mo;hb;rf^-1 irreflexive) and RMW atomicity. Having no relaxed accesses it is free of out-of-thin-air behaviour, and unlike WRA it provides SC-per-location. It still allows the 2+2W outcome that the strengthening SRA forbids, and store buffering and IRIW, which SC forbids. This is the fragment the zoo's PSI and SI reference implementations are built over, and the source fragment whose standard POWER compilation SRA exactly characterises.

Cat model

Expressible in cat author-extrapolated

As SRA but with write-coherence (mo;hb irreflexive) in place of strong-write-coherence — the release/acquire restriction of the vendored cpp11.cat and rc11.cat, and per-execution. Lahav & Boker 2022

Properties

Property vector author-extrapolated — set only where the model’s definition pins the cell down (unknown cells are omitted); cells citing a specific source are marked.

Compilation optimal mapping to
  • yes x86
  • yes POWER
Reasoning guarantees
  • yes Coherence
  • yes No out-of-thin-air

Ordering relationships

Strictly weaker than
  • Strong Release-Acquire (SRA) — SRA replaces RA's write-coherence (mo;hb irreflexive — a local agreement between modification order and happens-before) with strong-write-coherence ((hb ∪ mo)+ irreflexive — a global one), keeping RA's other axioms (Lahav & Boker, Table 1); containment is immediate. Strictness is the 2+2W program of Lahav et al. 2016, Lahav & Boker Ex. 3.6: x:=1; y:=2; a:=y || y:=1; x:=2; b:=x with a=b=1. The outcome forces mo edges W(y,2) -> W(y,1) and W(x,2) -> W(x,1), closing an (hb ∪ mo) cycle that SRA forbids while each mo;hb step alone satisfies write-coherence, so RA allows it. Machine-checked: litmus/models/ra.cat and litmus/models/sra.cat are authored for this dataset and differ in that one axiom, and litmus/strictly-weaker/SRA-vs-RA/ runs 2+2W under both (Sometimes 1 8 vs Never 0 5). Because both cat models are hand-written rather than vendored, the directory also carries controls run by run.sh: MP+relacq must be forbidden by both, and IRIW must be allowed by both — the latter checked against Lahav & Boker Ex. 3.5, which marks IRIW allowed under RA and SRA alike. Containment remains the cited one-axiom argument; herd7 decides the strictness half only.
Strictly stronger than
  • Weak Release-Acquire (WRA) — WRA drops modification order entirely, replacing RA's write-coherence and read-coherence with weak-read-coherence over hb|loc; Lahav & Boker note that write-coherence implies [W];hb|loc;[W] subset of mo, so read-coherence implies weak-read-coherence and RA contains WRA (Prop. 3.2). Strictness is Ex. 3.7, three single-location programs (WW, Oscillating, SF) allowed by WRA and forbidden by RA: WRA does not provide SC-per-location, so even one-location programs may behave non-sequentially.
Equivalent to
  • Repaired C11 (RC11) — RA is the release/acquire fragment of the C/C++11 model — release stores, acquire reads, acquire-release RMWs (Lahav & Boker, §3.1). RC11's repairs concern the SC axioms and the relaxed/thin-air fragment, none of which this fragment contains, so RC11 and C11 coincide on it. Drawn against RC11 rather than C11 to match the existing PSI and SI compilation notes, which target 'the release-acquire (RA) fragment of RC11'.
Compilation target of
  • Parallel Snapshot Isolation (PSI) — Raad, Lahav & Vafeiadis (ESOP 2018) give PSI a lock-based reference implementation built on the release-acquire (RA) fragment of the C/C++11 memory model, proved sound and complete against the declarative PSI specification (and likewise Robust PSI). Retargeted from RC11 onto RA in 1.4.1: the target has always been the release-acquire fragment, as this note already said, and RA became a node in 1.4.0.
  • Snapshot Isolation (SI) — Raad, Lahav & Vafeiadis (VMCAI 2019) give SI two timestamp-free lock-based (MRSW) reference implementations built on the release-acquire (RA) fragment of C/C++11, proved sound and complete against the declarative SI specification (and likewise Robust SI). Retargeted from RC11 onto RA in 1.4.1: the target has always been the release-acquire fragment, as this note already said, and RA became a node in 1.4.0.

References

  • Mark Batty, Scott Owens, Susmit Sarkar, Peter Sewell, Tjark Weber. Mathematizing C++ Concurrency. POPL 2011, 2011. doi:10.1145/1926385.1926394
  • Ori Lahav, Udi Boker. What's Decidable about Causally Consistent Shared Memory?. ACM Trans. Program. Lang. Syst. 44(2), Article 8, 2022. doi:10.1145/3505273