Repairing sequential consistency in C/C++11

Ori Lahav, Viktor Vafeiadis, Jeehoon Kang, Chung Kil Hur, Derek Dreyer

Research output: Chapter in Book/Report/Conference proceedingConference contributionpeer-review

70 Scopus citations

Abstract

The C/C++11 memory model defines the semantics of concurrent memory accesses in C/C++, and in particular supports racy "atomic" accesses at a range of different consistency levels, from very weak consistency ("relaxed") to strong, sequential consistency ("SC"). Unfortunately, as we observe in this paper, the semantics of SC atomic accesses in C/C++11, as well as in all proposed strengthenings of the semantics, is flawed, in that (contrary to previously published results) both suggested compilation schemes to the Power architecture are unsound. We propose a model, called RC11 (for Repaired C11), with a better semantics for SC accesses that restores the soundness of the compilation schemes to Power, maintains the DRF-SC guarantee, and provides stronger, more useful, guarantees to SC fences. In addition, we formally prove, for the first time, the correctness of the proposed stronger compilation schemes to Power that preserve load-to-store ordering and avoid "out-of-thin-air" reads.

Original languageEnglish
Title of host publicationPLDI 2017 - Proceedings of the 38th ACM SIGPLAN Conference on Programming Language Design and Implementation
EditorsAlbert Cohen, Martin Vechev
PublisherAssociation for Computing Machinery
Pages618-632
Number of pages15
ISBN (Electronic)9781450349888
DOIs
StatePublished - 14 Jun 2017
Externally publishedYes
Event38th ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI 2017 - Barcelona, Spain
Duration: 18 Jun 201723 Jun 2017

Publication series

NameProceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI)
VolumePart F128414

Conference

Conference38th ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI 2017
Country/TerritorySpain
CityBarcelona
Period18/06/1723/06/17

Keywords

  • C++11
  • Declarative semantics
  • Sequential consistency
  • Weak memory models

Fingerprint

Dive into the research topics of 'Repairing sequential consistency in C/C++11'. Together they form a unique fingerprint.

Cite this