An Operational Semantics for C/C++11 Concurrency

被引:26
|
作者
Nienhuis, Kyndylan [1 ]
Memarian, Kayvan [1 ]
Sewell, Peter [1 ]
机构
[1] Univ Cambridge, Cambridge CB2 1TN, England
基金
英国工程与自然科学研究理事会;
关键词
C/C plus; Concurrency;
D O I
10.1145/3022671.2983997
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
The C/C++11 concurrency model balances two goals: it is relaxed enough to be efficiently implementable and (leaving aside the "thin-air" problem) it is strong enough to give useful guarantees to programmers. It is mathematically precise and has been used in verification research and compiler testing. However, the model is expressed in an axiomatic style, as predicates on complete candidate executions. This suffices for computing the set of allowed executions of a small litmus test, but it does not directly support the incremental construction of executions of larger programs. It is also at odds with conventional operational semantics, as used implicitly in the rest of the C/C++ standards. Our main contribution is the development of an operational model for C/C++11 concurrency. This covers all the features of the previous formalised axiomatic model, and we have a mechanised proof that the two are equivalent, in Isabelle/HOL. We also integrate this semantics with an operational semantics for sequential C (described elsewhere); the combined semantics can incrementally execute programs in a small fragment of C. Doing this uncovered several new aspects of the C/C++11 model: we show that one cannot build an equivalent operational model that simply follows program order, sequential consistent order, or the synchronises-with order. The first negative result is forced by hardware-observable behaviour, but the latter two are not, and so might be ameliorated by changing C/C++11. More generally, we hope that this work, with its focus on incremental construction of executions, will inform the future design of new concurrency models.
引用
收藏
页码:111 / 128
页数:18
相关论文
共 50 条
  • [21] Transforming C++11 Code to C++03 to Support Legacy Compilation Environments
    Antal, Gabor
    Havas, David
    Siket, Istvan
    Beszedes, Arpad
    Ferenc, Rudolf
    Mihalicza, Jozsef
    [J]. 2016 IEEE 16TH INTERNATIONAL WORKING CONFERENCE ON SOURCE CODE ANALYSIS AND MANIPULATION (SCAM), 2016, : 177 - 186
  • [22] NISTfit: A Natively Multithreaded C++11 Framework for Model Development
    Bell, Ian
    Kunick, Matthias
    [J]. JOURNAL OF RESEARCH OF THE NATIONAL INSTITUTE OF STANDARDS AND TECHNOLOGY, 2018, 123
  • [23] An Operational Semantics for True Concurrency in BDI Agent Systems
    de Silva, Lavindra
    [J]. THIRTY-FOURTH AAAI CONFERENCE ON ARTIFICIAL INTELLIGENCE, THE THIRTY-SECOND INNOVATIVE APPLICATIONS OF ARTIFICIAL INTELLIGENCE CONFERENCE AND THE TENTH AAAI SYMPOSIUM ON EDUCATIONAL ADVANCES IN ARTIFICIAL INTELLIGENCE, 2020, 34 : 7119 - 7126
  • [24] Prialt in Handel-C: An operational semantics
    Butterfield A.
    Woodcock J.
    [J]. International Journal on Software Tools for Technology Transfer, 2005, 7 (3) : 248 - 267
  • [25] C++11/14 Mutation Operators Based on Common Fault Patterns
    Parsai, Ali
    Demeyer, Serge
    De Busser, Seph
    [J]. TESTING SOFTWARE AND SYSTEMS (ICTSS 2018), 2018, 11146 : 102 - 118
  • [26] Hydra: a C++11 framework for data analysis in massively parallel platforms
    Alves Junior, A. A.
    Sokoloff, M. D.
    [J]. 18TH INTERNATIONAL WORKSHOP ON ADVANCED COMPUTING AND ANALYSIS TECHNIQUES IN PHYSICS RESEARCH (ACAT2017), 2018, 1085
  • [27] C++11实现可变参数泛型抽象工厂
    闵军
    罗泓
    [J]. 软件工程, 2017, 20 (05) : 18 - 22
  • [28] MolBioLib: a C++11 framework for rapid development and deployment of bioinformatics tasks
    Ohsumi, Toshiro K.
    Borowsky, Mark L.
    [J]. BIOINFORMATICS, 2012, 28 (19) : 2412 - 2416
  • [29] Rewriting Semantics and Analysis of Concurrency Features for a C-like Language
    Serrbanuta, Traian Florin
    [J]. ELECTRONIC NOTES IN THEORETICAL COMPUTER SCIENCE, 2014, 304 : 167 - 182
  • [30] NSTX-U Advances in Real-Time C++11 on Linux
    Erickson, Keith G.
    [J]. IEEE TRANSACTIONS ON NUCLEAR SCIENCE, 2015, 62 (04) : 1758 - 1765