TY - GEN
T1 - Repairing sequential consistency in C/C++11
AU - Lahav, Ori
AU - Vafeiadis, Viktor
AU - Kang, Jeehoon
AU - Hur, Chung Kil
AU - Dreyer, Derek
N1 - Publisher Copyright:
© 2017 ACM.
PY - 2017/6/14
Y1 - 2017/6/14
N2 - 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.
AB - 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.
KW - C++11
KW - Declarative semantics
KW - Sequential consistency
KW - Weak memory models
UR - http://www.scopus.com/inward/record.url?scp=85025169678&partnerID=8YFLogxK
U2 - 10.1145/3062341.3062352
DO - 10.1145/3062341.3062352
M3 - ???researchoutput.researchoutputtypes.contributiontobookanthology.conference???
AN - SCOPUS:85025169678
T3 - Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI)
SP - 618
EP - 632
BT - PLDI 2017 - Proceedings of the 38th ACM SIGPLAN Conference on Programming Language Design and Implementation
A2 - Cohen, Albert
A2 - Vechev, Martin
PB - Association for Computing Machinery
T2 - 38th ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI 2017
Y2 - 18 June 2017 through 23 June 2017
ER -