Repairing Sequential Consistency in C/C++11
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.
Paper
-
Ori Lahav, Viktor Vafeiadis, Jeehoon Kang, Chung-Kil Hur, Derek Dreyer.
Repairing Sequential Consistency in C/C++11.
In PLDI 2017. ACM (June 2017)
[Full paper with appendix] [Slides]
[RC11 .cat file]
People
- Ori Lahav (MPI-SWS)
- Viktor Vafeiadis (MPI-SWS)
- Jeehoon Kang (Seoul National University)
- Chung-Kil Hur (Seoul National University)
- Derek Dreyer (MPI-SWS)