期刊文献+

An operational happens-before memory model 被引量:1

An operational 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 se- curity guarantee of Java. The resulting JMM is complex and difficult to understand. It also has many anti-intuitive behav- iors, as demonstrated by the "ugly examples" by Aspinall and ~ev6~ [1]. Furthermore, HMM (and JMM) specifies only what execution traces are acceptable, but says 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 de- signed 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 instruc- tions to be executed multiple times, which can be used to model many useful speculations and optimization. The model is weaker than JMM for lockless programs, thus can accom- modate more optimization, such as the reordering of inde- pendent 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. 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 se- curity guarantee of Java. The resulting JMM is complex and difficult to understand. It also has many anti-intuitive behav- iors, as demonstrated by the "ugly examples" by Aspinall and ~ev6~ [1]. Furthermore, HMM (and JMM) specifies only what execution traces are acceptable, but says 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 de- signed 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 instruc- tions to be executed multiple times, which can be used to model many useful speculations and optimization. The model is weaker than JMM for lockless programs, thus can accom- modate more optimization, such as the reordering of inde- pendent 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.
出处 《Frontiers of Computer Science》 SCIE EI CSCD 2016年第1期54-81,共28页 中国计算机科学前沿(英文版)
关键词 relaxed memory model happens-before opera-tonal semantics DRF-Guarantee JMM relaxed memory model, happens-before, opera-tonal semantics, DRF-Guarantee, JMM
  • 相关文献

参考文献18

  • 1Aspinall D, Sevcfk J. Java memory model examples: good, bad and ugly. In: Proceedings of Verification and Analysis of Multi-threaded Java-like Programs. 2007,66-80. 被引量:1
  • 2Lamport L. How to make a multiprocessor computer that correctly exe?cutes multiprocess programs. IEEE Transactions on Computers, 1979, 28(9): 690-691. 被引量:1
  • 3Boehm H J. Threads cannot be implemented as a library. In: Proceed?ings of Programming Language Design and Implementation. 2005, 261-268. 被引量:1
  • 4Adve S V, Gharachorloo K. Shared memory consistency models: a tu?torial. IEEE Transactions on Computers, 1996, 29(12): 66-76. 被引量:1
  • 5Manson J, Pugh W, Adve S V. The Java memory model. In: Proceed?ings of the 32nd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages. 2005,378-391. 被引量:1
  • 6Cenciarelli P, Knapp A, Sibilio E. The Java memory model: opera?tionally, denotationally, axiomatically. In: Proceedings of the 16th Eu?ropean Symposium on Programming. 2007, 331-346. 被引量:1
  • 7Zhang Y, Feng X. An operational approach to happens-before memory model. In: Proceedings of the 7th International Symposium on Theo?retical Aspects of Software Engineering. 2013, 121-128. 被引量:1
  • 8Lamport L. Time, clocks, and the ordering of events in a distributed system. Communications of the ACM, 1978, 21(7): 558-565. 被引量:1
  • 9Aspinall D, Sevcik J. Formalising Java's data race free guarantee. In: Proceedings of Theorem Proving in Higher Order Logics. 2007, 22-37. 被引量:1
  • 10Huisman M, Petri G. The Java memory model: a formal explanation. In: Proceedings of Verification and Analysis of Multi-threaded Java?like Programs. 2007, 81-96. 被引量:1

同被引文献3

引证文献1

二级引证文献1

相关作者

内容加载中请稍等...

相关机构

内容加载中请稍等...

相关主题

内容加载中请稍等...

浏览历史

内容加载中请稍等...
;
使用帮助 返回顶部