“先发生”内存模型的操作方法

Y. Zhang, Xinyu Feng
{"title":"“先发生”内存模型的操作方法","authors":"Y. Zhang, Xinyu Feng","doi":"10.1109/TASE.2013.24","DOIUrl":null,"url":null,"abstract":"Happens-before memory model (HMM) is used as the basis of Java memory model (JMM). Although HMM itself is simple, some complex axioms have to be introduced in JMM to prevent the causality loop, which causes absurd out-of-thin-air reads that may break the type safety and security guarantee of Java. The resulting JMM is complex and difficult to understand. It also has many anti-intuitive behaviors, as demonstrated by the \"ugly examples\" by Aspinall and ?Sev?c'ik [3]. Furthermore, HMM (and JMM) specify only what execution traces are acceptable, but say nothing about how these traces are generated. This gap makes it difficult for static reasoning about programs. In this paper we present OHMM, an operational variation of HMM. The model is specified by giving an operational semantics to a language running on an abstract machine designed to simulate HMM. Thanks to its generative nature, the model naturally prevents out-of-thin-air reads. On the other hand, it uses a novel replay mechanism to allow instructions to be executed multiple times, which can be used to model many useful speculations and optimizations. The model is weaker than JMM for lockless programs, thus can accommodate more optimizations, such as the reordering of independent memory accesses that is not valid in JMM. Program behaviors are more natural in this model than in JMM, and many of the anti-intuitive examples in JMM are no longer valid here. We hope OHMM can serve as the basis for new memory models for Java-like languages.","PeriodicalId":346899,"journal":{"name":"2013 International Symposium on Theoretical Aspects of Software Engineering","volume":"117 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2013-07-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"6","resultStr":"{\"title\":\"An Operational Approach to Happens-Before Memory Model\",\"authors\":\"Y. Zhang, Xinyu Feng\",\"doi\":\"10.1109/TASE.2013.24\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"Happens-before memory model (HMM) is used as the basis of Java memory model (JMM). Although HMM itself is simple, some complex axioms have to be introduced in JMM to prevent the causality loop, which causes absurd out-of-thin-air reads that may break the type safety and security guarantee of Java. The resulting JMM is complex and difficult to understand. It also has many anti-intuitive behaviors, as demonstrated by the \\\"ugly examples\\\" by Aspinall and ?Sev?c'ik [3]. Furthermore, HMM (and JMM) specify only what execution traces are acceptable, but say nothing about how these traces are generated. This gap makes it difficult for static reasoning about programs. In this paper we present OHMM, an operational variation of HMM. The model is specified by giving an operational semantics to a language running on an abstract machine designed to simulate HMM. Thanks to its generative nature, the model naturally prevents out-of-thin-air reads. On the other hand, it uses a novel replay mechanism to allow instructions to be executed multiple times, which can be used to model many useful speculations and optimizations. The model is weaker than JMM for lockless programs, thus can accommodate more optimizations, such as the reordering of independent memory accesses that is not valid in JMM. Program behaviors are more natural in this model than in JMM, and many of the anti-intuitive examples in JMM are no longer valid here. We hope OHMM can serve as the basis for new memory models for Java-like languages.\",\"PeriodicalId\":346899,\"journal\":{\"name\":\"2013 International Symposium on Theoretical Aspects of Software Engineering\",\"volume\":\"117 1\",\"pages\":\"0\"},\"PeriodicalIF\":0.0000,\"publicationDate\":\"2013-07-01\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"6\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"2013 International Symposium on Theoretical Aspects of Software Engineering\",\"FirstCategoryId\":\"1085\",\"ListUrlMain\":\"https://doi.org/10.1109/TASE.2013.24\",\"RegionNum\":0,\"RegionCategory\":null,\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"\",\"JCRName\":\"\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"2013 International Symposium on Theoretical Aspects of Software Engineering","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/TASE.2013.24","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 6

摘要

发生前内存模型(HMM)被用作Java内存模型(JMM)的基础。虽然HMM本身很简单,但是为了防止因果循环,必须在JMM中引入一些复杂的公理,因为因果循环会导致荒谬的无端读取,从而破坏Java的类型安全和安全性保证。得到的JMM非常复杂,难以理解。它也有许多反直觉的行为,正如Aspinall和?Sev?c 'ik[3]。此外,HMM(和JMM)只指定可接受的执行跟踪,但没有说明如何生成这些跟踪。这种差距使得对程序进行静态推理变得困难。在本文中,我们提出了HMM, HMM的一个可操作变体。该模型是通过向运行在设计用于模拟HMM的抽象机器上的语言提供操作语义来指定的。由于其生成特性,该模型自然地防止了凭空读取。另一方面,它使用了一种新颖的重放机制,允许多次执行指令,这可以用来模拟许多有用的推测和优化。对于无锁程序,该模型比JMM弱,因此可以容纳更多的优化,例如在JMM中无效的独立内存访问的重新排序。在这个模型中,程序行为比在JMM中更自然,JMM中许多反直觉的例子在这里不再有效。我们希望OHMM可以作为类java语言的新内存模型的基础。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
An Operational Approach to Happens-Before Memory Model
Happens-before memory model (HMM) is used as the basis of Java memory model (JMM). Although HMM itself is simple, some complex axioms have to be introduced in JMM to prevent the causality loop, which causes absurd out-of-thin-air reads that may break the type safety and security guarantee of Java. The resulting JMM is complex and difficult to understand. It also has many anti-intuitive behaviors, as demonstrated by the "ugly examples" by Aspinall and ?Sev?c'ik [3]. Furthermore, HMM (and JMM) specify only what execution traces are acceptable, but say nothing about how these traces are generated. This gap makes it difficult for static reasoning about programs. In this paper we present OHMM, an operational variation of HMM. The model is specified by giving an operational semantics to a language running on an abstract machine designed to simulate HMM. Thanks to its generative nature, the model naturally prevents out-of-thin-air reads. On the other hand, it uses a novel replay mechanism to allow instructions to be executed multiple times, which can be used to model many useful speculations and optimizations. The model is weaker than JMM for lockless programs, thus can accommodate more optimizations, such as the reordering of independent memory accesses that is not valid in JMM. Program behaviors are more natural in this model than in JMM, and many of the anti-intuitive examples in JMM are no longer valid here. We hope OHMM can serve as the basis for new memory models for Java-like languages.
求助全文
通过发布文献求助,成功后即可免费获取论文全文。 去求助
来源期刊
自引率
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学术文献互助群
群 号:604180095
Book学术官方微信