Mathematizing C++ concurrency

Author:

Batty Mark1,Owens Scott1,Sarkar Susmit1,Sewell Peter1,Weber Tjark1

Affiliation:

1. University of Cambridge, Cambridge, United Kingdom

Abstract

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.

Publisher

Association for Computing Machinery (ACM)

Subject

Computer Graphics and Computer-Aided Design,Software

Reference33 articles.

1. Memory models

2. Fences in Weak Memory Models

3. ARM. ARM Architecture Reference Manual (ARMv7-A and ARMv7-R edition). April 2008. ARM. ARM Architecture Reference Manual (ARMv7-A and ARMv7-R edition). April 2008.

4. Foundations of the C++ concurrency memory model

5. P. Becker editor. Programming Languages --- C++. Final Committee Draft. 2010. ISO/IEC JTC1 SC22 WG21 N3092. P. Becker editor. Programming Languages --- C++. Final Committee Draft. 2010. ISO/IEC JTC1 SC22 WG21 N3092.

Cited by 52 articles. 订阅此论文施引文献 订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献

1. Robustness against the C/C++11 Memory Model;Proceedings of the 33rd ACM SIGSOFT International Symposium on Software Testing and Analysis;2024-09-11

2. Decidable Verification under Localized Release-Acquire Concurrency;Lecture Notes in Computer Science;2024

3. Formalization of Process-oriented Programs in poST Using Isabelle/HOL;2023 IEEE 24th International Conference of Young Professionals in Electron Devices and Materials (EDM);2023-06-29

4. Implementing and verifying release-acquire transactional memory in C11;Proceedings of the ACM on Programming Languages;2022-10-31

5. CAAT: consistency as a theory;Proceedings of the ACM on Programming Languages;2022-10-31

同舟云学术

1.学者识别学者识别

2.学术分析学术分析

3.人才评估人才评估

"同舟云学术"是以全球学者为主线,采集、加工和组织学术论文而形成的新型学术文献查询和分析系统,可以对全球学者进行文献检索和人才价值评估。用户可以通过关注某些学科领域的顶尖人物而持续追踪该领域的学科进展和研究前沿。经过近期的数据扩容,当前同舟云学术共收录了国内外主流学术期刊6万余种,收集的期刊论文及会议论文总量共计约1.5亿篇,并以每天添加12000余篇中外论文的速度递增。我们也可以为用户提供个性化、定制化的学者数据。欢迎来电咨询!咨询电话:010-8811{复制后删除}0370

www.globalauthorid.com

TOP

Copyright © 2019-2024 北京同舟云网络信息技术有限公司
京公网安备11010802033243号  京ICP备18003416号-3