TY - JOUR
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 - Weak memory models
KW - declarative semantics
KW - sequential consistency
UR - http://www.scopus.com/inward/record.url?scp=85084447725&partnerID=8YFLogxK
U2 - 10.1145/3140587.3062352
DO - 10.1145/3140587.3062352
M3 - ???researchoutput.researchoutputtypes.contributiontojournal.article???
AN - SCOPUS:85084447725
SN - 1523-2867
VL - 52
SP - 618
EP - 632
JO - SIGPLAN Notices (ACM Special Interest Group on Programming Languages)
JF - SIGPLAN Notices (ACM Special Interest Group on Programming Languages)
IS - 6
ER -