Mathematizing C plus plus Concurrency

被引:10
|
作者
Batty, Mark [1 ]
Owens, Scott [1 ]
Sarkar, Susmit [1 ]
Sewell, Peter [1 ]
Weber, Tjark [1 ]
机构
[1] Univ Cambridge, Cambridge CB2 1TN, England
基金
英国工程与自然科学研究理事会;
关键词
Documentation; Languages; Reliability; Standardization; Theory; Verification; Relaxed Memory Models; Semantics;
D O I
10.1145/1925844.1926394
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Shared-memory concurrency in C and C++ is pervasive in systems programming, but has long been poorly defined. This motivated an ongoing shared effort by the standards committees to specify concurrent behaviour in the next versions of both languages. They aim to provide strong guarantees for race-free programs, together with new (but subtle) relaxed-memory atomic primitives for high-performance concurrent code. However, the current draft standards, while the result of careful deliberation, are not yet clear and rigorous definitions, and harbour substantial problems in their details. In this paper we establish a mathematical (yet readable) semantics for C++ concurrency. We aim to capture the intent of the current ('Final Committee') Draft as closely as possible, but discuss changes that fix many of its problems. We prove that a proposed x86 implementation of the concurrency primitives is correct with respect to the x86-TSO model, and describe our CPPMEM tool for exploring the semantics of examples, using code generated from our Isabelle/HOL definitions. Having already motivated changes to the draft standard, this work will aid discussion of any further changes, provide a correctness condition for compilers, and give a much-needed basis for analysis and verification of concurrent C and C++ programs.
引用
收藏
页码:55 / 66
页数:12
相关论文
共 50 条
  • [31] The magnetic spectrum of beta rays emitted by AcB plus C plus C' plus C''
    Graf, T
    [J]. COMPTES RENDUS HEBDOMADAIRES DES SEANCES DE L ACADEMIE DES SCIENCES, 1933, 197 : 238 - 241
  • [32] C plus plus standards - Response
    Stevens, A
    [J]. DR DOBBS JOURNAL, 1997, 22 (11): : 12 - 12
  • [33] Optimizations in C plus plus Compilers
    Godbolt, Matt
    [J]. COMMUNICATIONS OF THE ACM, 2020, 63 (02) : 41 - 49
  • [34] A C plus plus integrator class
    Conway, DJ
    [J]. DR DOBBS JOURNAL, 1995, 20 (12): : 52 - +
  • [35] C plus plus string performance
    Kochubeevsky, L
    [J]. DR DOBBS JOURNAL, 2003, 28 (10): : 28 - +
  • [36] C/C plus plus Thread Safety Analysis
    Hutchins, DeLesley
    Ballman, Aaron
    Sutherland, Dean
    [J]. 2014 14TH IEEE INTERNATIONAL WORKING CONFERENCE ON SOURCE CODE ANALYSIS AND MANIPULATION (SCAM 2014), 2014, : 41 - 46
  • [37] C plus plus Web Framework: A Web Framework for Web Development using C plus plus and Qt
    Lima, Herik
    Eler, Marcelo Medeiros
    [J]. ICEIS: PROCEEDINGS OF THE 23RD INTERNATIONAL CONFERENCE ON ENTERPRISE INFORMATION SYSTEMS - VOL 2, 2021, : 76 - 87
  • [38] Bridging Excel and C/C plus plus Code
    Punuru, Janardhana R.
    Knopf, F. Carl
    [J]. COMPUTER APPLICATIONS IN ENGINEERING EDUCATION, 2008, 16 (04) : 289 - 304
  • [39] Clacc: OpenACC for C/C plus plus in Clang
    Denny, Joel E.
    Lee, Seyong
    Valero-Lara, Pedro
    Gonzalez-Tallada, Marc
    Teranishi, Keita
    Vetter, Jeffrey S.
    [J]. INTERNATIONAL JOURNAL OF HIGH PERFORMANCE COMPUTING APPLICATIONS, 2024, 38 (05): : 427 - 446
  • [40] Precise measurement of the branching fractions of J/ψ→<overline>Λπ plus Σ- plus c.c. and J/ψ→<overline>Λπ-Σ plus plus c.c
    Ablikim, M.
    Achasov, M. N.
    Adlarson, P.
    Aliberti, R.
    Amoroso, A.
    An, M. R.
    An, Q.
    Bai, Y.
    Bakina, O.
    Balossino, I.
    Ban, Y.
    Batozskaya, V.
    Begzsuren, K.
    Berger, N.
    Berlowski, M.
    Bertani, M.
    Bettoni, D.
    Bianchi, F.
    Bianco, E.
    Bloms, J.
    Bortone, A.
    Boyko, I.
    Briere, R. A.
    Brueggemann, A.
    Cai, H.
    Cai, X.
    Calcaterra, A.
    Cao, G. F.
    Cao, N.
    Cetin, S. A.
    Chang, J. F.
    Chang, T. T.
    Chang, W. L.
    Che, G. R.
    Chelkov, G.
    Chen, C.
    Chen, Chao
    Chen, G.
    Chen, H. S.
    Chen, M. L.
    Chen, S. J.
    Chen, S. M.
    Chen, T.
    Chen, X. R.
    Chen, X. T.
    Chen, Y. B.
    Chen, Y. Q.
    Chen, Z. J.
    Cheng, W. S.
    Choi, S. K.
    [J]. PHYSICAL REVIEW D, 2023, 108 (11)