DocumentCode
3021891
Title
An Operational Approach to Happens-Before Memory Model
Author
Yang Zhang ; Xinyu Feng
Author_Institution
Univ. of Sci. & Technol. of China, Hefei, China
fYear
2013
fDate
1-3 July 2013
Firstpage
121
Lastpage
128
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.
Keywords
Java; optimisation; reasoning about programs; storage management; HMM; JMM; Java memory model; OHMM; abstract machine; happens-before memory model; lockless programs; novel replay mechanism; operational approach; out-of-thin-air reads; static reasoning about programs; Abstracts; Hidden Markov models; Instruction sets; Optimization; Registers; Semantics; Synchronization;
fLanguage
English
Publisher
ieee
Conference_Titel
Theoretical Aspects of Software Engineering (TASE), 2013 International Symposium on
Conference_Location
Birmingham
Type
conf
DOI
10.1109/TASE.2013.24
Filename
6597886
Link To Document