Over the years, several memory models have been proposed to capture the subtle concurrency semantics of C/C++.One of the most fundamental problems associated with a memory model M is consistency checking: given an execution X, is X consistent with M? This problem lies at the heart of numerous applications, including specification testing and litmus tests, stateless model checking, and dynamic analyses. As such, it has been explored extensively and its complexity is well-understood for traditional models like SC and TSO. However, less is known for the numerous model variants of C/C++, for which the problem becomes challenging due to the intricacies of their concurrency primitives. In this work we study the problem of consistency checking for popular variants of the C11 memory model, in particular, the RC20 model, its release-acquire (RA) fragment, the strong and weak variants of RA (SRA and WRA), as well as the Relaxed fragment of RC20. Motivated by applications in testing and model checking, we focus on reads-from consistency checking. The input is an execution X specifying a set of events, their program order and their reads-from relation, and the task is to decide the existence of a modification order on the writes of X that makes X consistent in a memory model. We draw a rich complexity landscape for this problem; our results include (i)~nearly-linear-time algorithms for certain variants, which improve over prior results, (ii)~fine-grained optimality results, as well as (iii)~matching upper and lower bounds (NP-hardness) for other variants. To our knowledge, this is the first work to characterize the complexity of consistency checking for C11 memory models. We have implemented our algorithms inside the TruSt model checker and the C11Tester testing tool. Experiments on standard benchmarks show that our new algorithms improve consistency checking, often by a significant margin.


翻译:多年来,已经提出了多个内存模型来捕捉 C/C++ 的微妙并发语义之一最基本的问题是一致性检查:给定执行 X,是否与模型 M 兼容?这个问题涉及许多应用程序,包括规范测试和范例测试、无状态模型检查和动态分析。因此,它已经得到了广泛的研究,而传统模型(如 SC 和 TSO)的复杂性已经得到了很好的理解。然而,对于 C/C++ 的许多模型变体,该问题的了解较少,因为由于它们并发原语的复杂性,该问题变得具有挑战性。在这项工作中,我们研究了 C11 内存模型的流行变体的一致性检查问题,特别是 RC20 模型,它的释放-获取碎片、RA 的强弱变体(SRA 和 WRA),以及 RC20 的松散碎片。受到测试和模型检查应用的启发,我们集中研究了读取-写入一致性检查。输入是一个指定事件集、它们的程序顺序和读取-写入关系的执行 X,任务是决定对 X 的写入进行修改的顺序是否使得 X 在内存模型中一致。我们为这个问题绘制了一个丰富的复杂性景观;我们的结果包括 (i) 某些变体的近线性时间算法,它们改进了先前的结果,(ii) 细粒度的优化结果,以及 (iii) 其他变体的匹配上界和下界(NP-难度)。据我们所知,这是第一个表征 C11 内存模型一致性检查复杂性的工作。我们已经在 TruSt 模型检查器和 C11Tester 测试工具中实现了我们的算法。对标准基准的实验表明,我们的新算法提高了一致性检查,通常有显着的改进。

0
下载
关闭预览

相关内容

【文本生成现代方法】Modern Methods for Text Generation
专知会员服务
43+阅读 · 2020年9月11日
FlowQA: Grasping Flow in History for Conversational Machine Comprehension
专知会员服务
25+阅读 · 2019年10月18日
令人沮丧的C++性能调试
InfoQ
0+阅读 · 2022年10月24日
是否应该在 Kubernetes 上运行数据库?
CSDN
0+阅读 · 2022年9月1日
VCIP 2022 Call for Demos
CCF多媒体专委会
1+阅读 · 2022年6月6日
吐血整理!140种Python标准库、第三方库和外部工具都有了
炼数成金订阅号
14+阅读 · 2019年7月30日
Github项目推荐 | gensim - Python中的主题建模
AI研习社
15+阅读 · 2019年3月16日
R工程化—Rest API 之plumber包
R语言中文社区
11+阅读 · 2018年12月25日
从 Encoder 到 Decoder 实现 Seq2Seq 模型
AI研习社
10+阅读 · 2018年2月10日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2013年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
1+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2011年12月31日
国家自然科学基金
0+阅读 · 2008年12月31日
国家自然科学基金
0+阅读 · 2008年12月31日
VIP会员
相关VIP内容
【文本生成现代方法】Modern Methods for Text Generation
专知会员服务
43+阅读 · 2020年9月11日
FlowQA: Grasping Flow in History for Conversational Machine Comprehension
专知会员服务
25+阅读 · 2019年10月18日
相关资讯
令人沮丧的C++性能调试
InfoQ
0+阅读 · 2022年10月24日
是否应该在 Kubernetes 上运行数据库?
CSDN
0+阅读 · 2022年9月1日
VCIP 2022 Call for Demos
CCF多媒体专委会
1+阅读 · 2022年6月6日
吐血整理!140种Python标准库、第三方库和外部工具都有了
炼数成金订阅号
14+阅读 · 2019年7月30日
Github项目推荐 | gensim - Python中的主题建模
AI研习社
15+阅读 · 2019年3月16日
R工程化—Rest API 之plumber包
R语言中文社区
11+阅读 · 2018年12月25日
从 Encoder 到 Decoder 实现 Seq2Seq 模型
AI研习社
10+阅读 · 2018年2月10日
相关基金
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2013年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
1+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2011年12月31日
国家自然科学基金
0+阅读 · 2008年12月31日
国家自然科学基金
0+阅读 · 2008年12月31日
Top
微信扫码咨询专知VIP会员