{"title":"Fence Synthesis under the C11 Memory Model","authors":"Sanjana Singh, Divyanjali Sharma, Ishita Jaju, Subodh Sharma","doi":"10.48550/arXiv.2208.00285","DOIUrl":null,"url":null,"abstract":"The C/C++11 (C11) standard offers a spectrum of ordering guarantees on memory access operations. The combinations of such orderings pose a challenge in developing correct and efficient weak memory programs. A common solution to preclude those program outcomes that violate the correctness specification is using C11 synchronization-fences, which establish ordering on program events. The challenge is in choosing a combination of fences that (i) restores the correctness of the input program, with (ii) as little impact on efficiency as possible (i.e., the smallest set of weakest fences). This problem is the optimal fence synthesis problem and is NP-hard for straight-line programs. In this work, we propose the first fence synthesis technique for C11 programs called FenSying and show its optimality. We additionally propose a near-optimal efficient alternative called fFenSying. We prove the optimality of FenSying and the soundness of fFenSying and present an implementation of both techniques. Finally, we contrast the performance of the two techniques and empirically demonstrate fFenSyings effectiveness.","PeriodicalId":335085,"journal":{"name":"Automated Technology for Verification and Analysis","volume":"398 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2022-07-30","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Automated Technology for Verification and Analysis","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.48550/arXiv.2208.00285","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0
Abstract
The C/C++11 (C11) standard offers a spectrum of ordering guarantees on memory access operations. The combinations of such orderings pose a challenge in developing correct and efficient weak memory programs. A common solution to preclude those program outcomes that violate the correctness specification is using C11 synchronization-fences, which establish ordering on program events. The challenge is in choosing a combination of fences that (i) restores the correctness of the input program, with (ii) as little impact on efficiency as possible (i.e., the smallest set of weakest fences). This problem is the optimal fence synthesis problem and is NP-hard for straight-line programs. In this work, we propose the first fence synthesis technique for C11 programs called FenSying and show its optimality. We additionally propose a near-optimal efficient alternative called fFenSying. We prove the optimality of FenSying and the soundness of fFenSying and present an implementation of both techniques. Finally, we contrast the performance of the two techniques and empirically demonstrate fFenSyings effectiveness.
C/ c++ 11 (C11)标准为内存访问操作提供了一系列排序保证。这些顺序的组合对开发正确有效的弱记忆程序提出了挑战。防止这些违反正确性规范的程序结果的常见解决方案是使用C11同步栅栏,它在程序事件上建立顺序。挑战在于选择一个栅栏的组合(i)恢复输入程序的正确性,(ii)对效率的影响尽可能小(即,最小的最弱栅栏集合)。该问题是最优围栏综合问题,是线性规划的np困难问题。本文提出了第一种用于C11程序的围栏合成技术——围栏合成,并证明了其最优性。我们还提出了一种近乎最优的高效替代方案,称为fFenSying。我们证明了分联的最优性和分联的合理性,并给出了两种技术的实现。最后,我们对比了两种技术的性能,并实证证明了fFenSyings的有效性。