Dynamic synthesis for relaxed memory models

Author:

Liu Feng1,Nedev Nayden1,Prisadnikov Nedyalko2,Vechev Martin3,Yahav Eran4

Affiliation:

1. Princeton University, Princeton, NJ, USA

2. Sofia University, Sofia, Bulgaria

3. ETH Zurich, Zurich, Switzerland

4. Technion, Haifa, Israel

Abstract

Modern architectures implement relaxed memory models which may reorder memory operations or execute them non-atomically. Special instructions called memory fences are provided, allowing control of this behavior. To implement a concurrent algorithm for a modern architecture, the programmer is forced to manually reason about subtle relaxed behaviors and figure out ways to control these behaviors by adding fences to the program. Not only is this process time consuming and error-prone, but it has to be repeated every time the implementation is ported to a different architecture. In this paper, we present the first scalable framework for handling real-world concurrent algorithms running on relaxed architectures. Given a concurrent C program, a safety specification, and a description of the memory model, our framework tests the program on the memory model to expose violations of the specification, and synthesizes a set of necessary ordering constraints that prevent these violations. The ordering constraints are then realized as additional fences in the program. We implemented our approach in a tool called DFence based on LLVM and used it to infer fences in a number of concurrent algorithms. Using DFence, we perform the first in-depth study of the interaction between fences in real-world concurrent C programs, correctness criteria such as sequential consistency and linearizability, and memory models such as TSO and PSO, yielding many interesting observations. We believe that this is the first tool that can handle programs at the scale and complexity of a lock-free memory allocator.

Publisher

Association for Computing Machinery (ACM)

Subject

Computer Graphics and Computer-Aided Design,Software

Reference31 articles.

1. Personal Communication with the Cilk Team 2011. Personal Communication with the Cilk Team 2011.

2. Shared memory consistency models: a tutorial

3. Laws of order

4. CheckFence

5. Effective Program Verification for Relaxed Memory Models

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

1. Risotto: A Dynamic Binary Translator for Weak Memory Model Architectures;Proceedings of the 28th ACM International Conference on Architectural Support for Programming Languages and Operating Systems, Volume 1;2022-12-19

2. Lasagne: a static binary translator for weak memory model architectures;Proceedings of the 43rd ACM SIGPLAN International Conference on Programming Language Design and Implementation;2022-06-09

3. Verifying Reachability for TSO Programs with Dynamic Thread Creation;Networked Systems;2022

4. Verifying observational robustness against a c11-style memory model;Proceedings of the ACM on Programming Languages;2021-01-04

5. Lock and Fence When Needed: State Space Exploration + Static Analysis = Improved Fence and Lock Insertion;Lecture Notes in Computer Science;2020

同舟云学术

1.学者识别学者识别

2.学术分析学术分析

3.人才评估人才评估

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

www.globalauthorid.com

TOP

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