Skip to main navigation Skip to search Skip to main content

Trace Semantics for C++11 Memory Model

  • Lili Xiao
  • , Huibiao Zhu*
  • , Sini Chen
  • , Mengda He
  • , Shengchao Qin
  • *Corresponding author for this work
  • Donghua University
  • East China Normal University
  • Teesside University
  • Xidian University

Research output: Contribution to journalArticlepeer-review

Abstract

The C and C++ languages introduced the relaxed-memory concurrency into the language specification for efficiency purposes in 2011. Trace semantics can provide the mathematical foundation for the proposed C++11 memory model, and there is a lack of investigation of trace semantics for C++11.The Promising Semantics (PS) of Kang et al. provides the standard SC-style operational semantics for the C++11 concurrency model, where "SC" refers to "Sequential Consistency". Inspired by PS, in this article we first investigate the trace semantics for the relaxed read and write accesses under C++11, acting in the denotational semantics style. In our semantic model, a trace is in the form of a sequence of snapshots, and the snapshots record the modification in the relevant global or local variables, and the thread view. Moreover, the trace semantics for the release/acquire accesses under C++11 is also explored, based on the separated thread views and newly added message views. When considering this trace model, different accesses bring in their unique snapshots, and make distinguished effects on the production of the sequences. For any given program, the proposed trace semantics in this article produces all the valid traces directly. Furthermore, our trace semantics, together with that for TSO and MCA ARMv8, has the possibility to be the foundation of the meta model of the trace semantics for weak memory models.

Original languageEnglish
Article number14
JournalFormal Aspects of Computing
Volume36
Issue number3
DOIs
StatePublished - 5 Sep 2024

Keywords

  • C++11 memory model
  • Weak memory models
  • concurrency
  • snapshots
  • trace semantics

Fingerprint

Dive into the research topics of 'Trace Semantics for C++11 Memory Model'. Together they form a unique fingerprint.

Cite this