Automatic inference of memory fences

M. Kuperstein, Martin T. Vechev, Eran Yahav
{"title":"Automatic inference of memory fences","authors":"M. Kuperstein, Martin T. Vechev, Eran Yahav","doi":"10.1145/2261417.2261438","DOIUrl":null,"url":null,"abstract":"This paper addresses the problem of placing memory fences in a concurrent program running on a relaxed memory model. Modern architectures implement relaxed memory models which may reorder memory operations or execute them non-atomically. Special instructions called memory fences are provided to the programmer, allowing control of this behavior. To ensure correctness of many algorithms, in particular of non-blocking ones, a programmer is often required to explicitly insert memory fences into her program. However, she must use as few fences as possible, or the benefits of the relaxed architecture may be lost. Placing memory fences is challenging and very error prone, as it requires subtle reasoning about the underlying memory model. We present a framework for automatic inference of memory fences in concurrent programs, assisting the programmer in this complex task. Given a finite-state program, a safety specification and a description of the memory model, our framework computes a set of ordering constraints that guarantee the correctness of the program under the memory model. The computed constraints are maximally permissive: removing any constraint from the solution would permit an execution violating the specification. Our framework then realizes the computed constraints as additional fences in the input program. We implemented our approach in a tool called FENDER and used it to infer correct and efficient placements of fences for several non-trivial algorithms, including practical concurrent data structures.","PeriodicalId":6479,"journal":{"name":"2016 Formal Methods in Computer-Aided Design (FMCAD)","volume":"76 1","pages":"111-119"},"PeriodicalIF":0.0000,"publicationDate":"2010-10-20","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"127","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"2016 Formal Methods in Computer-Aided Design (FMCAD)","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/2261417.2261438","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 127

Abstract

This paper addresses the problem of placing memory fences in a concurrent program running on a relaxed memory model. Modern architectures implement relaxed memory models which may reorder memory operations or execute them non-atomically. Special instructions called memory fences are provided to the programmer, allowing control of this behavior. To ensure correctness of many algorithms, in particular of non-blocking ones, a programmer is often required to explicitly insert memory fences into her program. However, she must use as few fences as possible, or the benefits of the relaxed architecture may be lost. Placing memory fences is challenging and very error prone, as it requires subtle reasoning about the underlying memory model. We present a framework for automatic inference of memory fences in concurrent programs, assisting the programmer in this complex task. Given a finite-state program, a safety specification and a description of the memory model, our framework computes a set of ordering constraints that guarantee the correctness of the program under the memory model. The computed constraints are maximally permissive: removing any constraint from the solution would permit an execution violating the specification. Our framework then realizes the computed constraints as additional fences in the input program. We implemented our approach in a tool called FENDER and used it to infer correct and efficient placements of fences for several non-trivial algorithms, including practical concurrent data structures.
内存栅栏的自动推理
本文讨论了在一个运行在宽松内存模型上的并发程序中放置内存栅栏的问题。现代架构实现了宽松的内存模型,可以重新排序内存操作或非原子地执行它们。为程序员提供了称为内存栅栏的特殊指令,允许控制这种行为。为了确保许多算法的正确性,特别是非阻塞算法,程序员通常需要显式地在程序中插入内存围栏。然而,她必须尽可能少地使用栅栏,否则可能会失去轻松架构的好处。设置内存栅栏是一项挑战,而且非常容易出错,因为它需要对底层内存模型进行微妙的推理。我们提出了一个在并发程序中自动推断内存栅栏的框架,以帮助程序员完成这一复杂的任务。给定一个有限状态程序,一个安全规范和内存模型的描述,我们的框架计算一组排序约束,以保证程序在内存模型下的正确性。计算约束是最大限度允许的:从解决方案中删除任何约束将允许违反规范的执行。然后,我们的框架将计算出的约束作为输入程序中的附加藩篱来实现。我们在一个名为FENDER的工具中实现了我们的方法,并使用它来推断几种重要算法(包括实际的并发数据结构)中围栏的正确和有效位置。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术官方微信