Java: Memory consistency and process coordination
In Java, some memory updates are necessarily visible to some threads but never to others. A definition of Java memory consistency must take this fact into consideration to capture the semantics of non-terminating systems, such as a Java operating system. This paper presents a programmer-centered formal definition of Java memory behavior that captures those semantics.
Our definition is employed to prove that it is impossible to provide fundamental process coordination in Java, such as critical sections and producer/consumer coordination, without the use of the synchronized and volatile constructs. However, we introduce a form of synchronization that is weaker than volatiles and would suffice to solve some of these problems in Java.
keywordsJava Java Virtual Machine memory consistency models process coordination critical section problem producer/consumer problem non-terminating systems
Unable to display preview. Download preview PDF.
- M. Ahamad, R. Bazzi, R. John, P. Kohli, and G. Neiger. The power of processor consistency. In Proc. 5th ACM Symp. on Parallel Algorithms and Architectures, pages 251–260, June 1993. Also available as College of Computing, Georgia Institute of Technology technical report GIT-CC-92/34.Google Scholar
- E. W. Dijkstra. Cooperating sequential processes. Technical Report EWD-123, Technological University, Eindhoven, the Netherlands, 1965. Reprinted in .Google Scholar
- M. Dubois, C. Scheurich, and F. Briggs. Memory access buffering in multiprocessors. Proc. of the 13th Annual Int'l Symp. on Computer Architecture, pages 434–442, June 1986.Google Scholar
- F. Genuys, editor. Programming Languages. Academic Press, 1968.Google Scholar
- A. Gontmakher and A. Schuster. Java consistency: Non-operational characterizations of Java memory behavior. Technical Report CS0922, Computer Science Department, Technion, November 1997.Google Scholar
- A. Gontmakher and A. Schuster. Characterizations of Java memory behavior. In Proc. of the 12th Int'l Parallel Processing Symp., April 1998.Google Scholar
- J. Goodman. Cache consistency and sequential consistency. Technical Report 61, IEEE Scalable Coherent Interface Working Group, March 1989.Google Scholar
- J. Gosling, B. Joy, and G. Steele. The Java Language Specifications. Addison-Wesley, 1996.Google Scholar
- L. Higham and J. Kawash. Critical sections and producer/consumer queues in weak memory systems. In Proc. of the 1997 Int'l Symp. on Parallel Architectures, Algorithms, and Networks, pages 56–63, December 1997.Google Scholar
- L. Higham and J. Kawash. Java: Memory consistency and process coordination. Technical Report 98/622/13, Department of Computer Science, The University of Calgary, April 1998.Google Scholar
- L. Higham, J. Kawash, and N. Verwaal. Defining and comparing memory consistency models. In Proc. of the 10th Int'l Conf. on Parallel and Distributed Computing Systems, pages 349–356, October 1997.Google Scholar
- L. Higham, J. Kawash, and N. Verwaal. Weak memory consistency models part I: Definitions and comparisons. Technical Report 98/612/03, Department of Computer Science, The University of Calgary, January 1998. Submitted for publication.Google Scholar
- L. Higham, J. Kawash, and N. Verwaal. Weak memory consistency models part II: Process coordination problems. Technical Report 98/613/04, Department of Computer Science, The University of Calgary, January 1998. Submitted for publication.Google Scholar
- J. Kawash. Process coordination issues in systems with weak memory consistency. Ph.D. dissertation draft, The University of Calgary.Google Scholar
- L. Lamport. How to make a multiprocessor computer that correctly executes multiprocess programs. IEEE Trans. on Computers, C-28(9):690–691, September 1979.Google Scholar
- T. Lindholm and F. Yellin. The Java Virtual Machine Specification. Addison-Wesley, 1996.Google Scholar
- R. J. Lipton and J. S. Sandberg. PRAM: A scalable shared memory. Technical Report 180–88, Department of Computer Science, Princeton University, September 1988.Google Scholar
- M. Raynal. Algorithms for Mutual Exclusion. The MIT Press, 1986.Google Scholar
- D. L. Weaver and T. Germond, editors. The SPARC Architecture Manual version 9. Prentice-Hall, 1994.Google Scholar