The Java memory model is fatally flawed
@article{Pugh2000TheJM, title={The Java memory model is fatally flawed}, author={William W. Pugh}, journal={Concurr. Pract. Exp.}, year={2000}, volume={12}, pages={445-455} }
The Java memory model described in Chapter 17 of the Java Language Specification gives constraints on how threads interact through memory. This chapter is hard to interpret and poorly understood; it imposes constraints that prohibit common compiler optimizations and are expensive to implement on existing hardware. Most JVMs violate the constraints of the existing Java memory model; conforming to the existing specification would impose significant performance penalties.
In addition…
99 Citations
The Java memory model
- Computer SciencePOPL '05
- 2005
The new Java model provides a simple interface for correctly synchronized programs -- it guarantees sequential consistency to data-race-free programs and could prove to be a useful basis for other programming languages that currently lack well-defined models, such as C++ and C#.
Requirements for Programming Language Memory Models
- Computer Science
- 2004
This paper outlines how the requirements for a new memory model were established, and what those requirements are, and does not outline the model itself; it merely provides a rationale.
A Java Compiler for Many Memory Models
- Computer ScienceJava Virtual Machine Research and Technology Symposium
- 2001
The approach the authors will discuss in this presentation, and in the remainder of this abstract, is radically different: Rather than having a xed memory model for the language, the memory model is allowed to be a property of a class.
The Java Memory Model: a Formal Explanation
- Computer Science
- 2007
This paper motivates the definition of the JMM, and shows the consequences of the wish to have the data race freeness guarantee and to forbid any out of thin air values to occur in an execution of multithreaded Java programs.
Semantics of Multithreaded Java
- Computer Science
- 2001
A new semantics for Java is proposed that addresses the issues raised by safety and multithreading, allows for aggressive compiler optimization and suggests solutions to some of the implementation issues.
Java and the Java Memory Model - A Unified, Machine-Checked Formalisation
- Computer ScienceESOP
- 2012
The Java data race freedom guarantee for the complete formalisation in a modular way is proved and it is proved that the assumptions about the sequential semantics explicit and how to discharge them are made.
Concurrent Constraint-Based Memory Machines: A Framework for Java Memory Models
- Computer ScienceASIAN
- 2004
A simple, general framework for the specification of memory models based on an abstract machine that uses sets of order and value constraints to communicate between threads and main memory is presented and may be used as the basis for developing a formal memory model for the java programming language.
A Unified, Machine-Checked Formalisation of Java and the Java Memory Model
- Computer Science
- 2011
The Java data race freedom guarantee for the complete formalisation in a modular way is proved and it is proved that the assumptions about the sequential semantics explicit and how to discharge them are made.
Core semantics of multithreaded Java
- Computer ScienceJGI '01
- 2001
A new core semantics for Java is proposed that allows for aggressive compiler optimization and addresses the safety and multithreading issues.
Program transformations in weak memory models
- Computer Science
- 2009
It is proved that all the authors' elimination and reordering transformations satisfy the DRF guarantee, i.e., the semantic transformations cannot introduce new behaviours for data race free programs, and all the transformations preserve data race freedom.
References
SHOWING 1-10 OF 12 REFERENCES
Java consistency: nonoperational characterizations for Java memory behavior
- Computer ScienceTOCS
- 2000
This work provides a simpler definition of consistency model for Java, in which it is clearly distinguish the consistency model that is promised to the programmer from that which should be implemented in the JVM, and precisely defines their discrepancy.
From Sequential to Multi-Threaded Java: An Event-Based Operational Semantics
- Computer ScienceAMAST
- 1997
Event spaces are included in the operational judgements to develop the semantics of the full multi-threaded sublanguage of Java, which is shown to extend the one for sequential Java conservatively, allowing sequential programs to be reasoned about in a simplified computational framework without loss of generality.
The power of processor consistency
- Computer ScienceSPAA '93
- 1993
This work uses a formal model to give two distinct definitions of processors consistency: one corresponding to Goodman’s original proposal and the other corresponding that given by the implementors of the DASH system.
The Java Language Specification
- Computer Science, Linguistics
- 1996
The Java Language Specification, Second Edition is the definitive technical reference for the Java programming language and provides complete, accurate, and detailed coverage of the syntax and semantics of the Java language.
Formal Syntax and Semantics of Java
- Computer ScienceLecture Notes in Computer Science
- 2002
This paper describes the Semantics of Java and proposes a Programmer Friendly Modular Definition of the Sem semantics of Java, as well as investigating the role of semantics in programming.
Java in practice : design styles and idioms for effective Java
- Art
- 1999
This chapter discusses type safety and constants, as well as diagrams and coding conventions, and the design principles and tips used in the development of types for knowledge representation.
Detecting equality of variables in programs
- Computer SciencePOPL '88
- 1988
An algorithm for detecting when two computations produce equivalent values by developing a static property called congruence, which is conservative in that any variables detected to be e:quivalent will in fact be equivalent, but not all equivalences are detected.
Global value numbers and redundant computations
- Computer SciencePOPL '88
- 1988
This work proposes a redundancy elimination algorithm that is global (in that it deals with the entire program), yet able to recognize redundancy among expressions that are lexitally different, and takes advantage of second order effects.
Impact of ”reads kill” in java
- http://www.cs.umd.edu/ ∼pugh/ java/readsKillImpact.html, May
- 1999
Impact of " reads kill " in java
- Impact of " reads kill " in java
- 1999