Skip to main content

A Unified Formal Specification and Analysis of the New Java Memory Models

  • Conference paper
  • First Online:
Book cover Abstract State Machines 2003 (ASM 2003)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 2589))

Included in the following conference series:

Abstract

In a multithreaded program running on a multiprocessor platform, different processors may observe operations in different orders. This may lead to surprising results not anticipated by the programmer. The problem is exacerbated by common compiler and hardware optimization techniques. A memory (consistency) model provides a contract between the system designer and the software designer that constrains the order in which operations are observed. Every memory model strikes some balance between strictness (simplifying program behavior) and laxness (permitting greater optimization). With its emphasis on cross-platform compatibility, the Java programming language needs a memory model that is satisfactory to language users and implementors. Everyone in the Java community must be able to understand the Java memory model and its ramifications. The description of the original Java memory model suffered from ambiguity and opaqueness, and attempts to interpret it revealed serious deficiencies. Two memory models have been proposed as replacements. Unfortunately, these two new models are described at different levels of abstraction and are represented in different formats, making it difficult to compare them. In this paper we formalize these models and develop a unified representation of them, using Abstract State Machines. Using our formal specifications, we relate the new Java memory models to the Location Consistency memory model and to each other.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Adve, S. V., Gharachorloo, K.: Shared Memory Consistency Models: A Tutorial. Research Report 95/7, Digital Western Research Laboratory (1995) 166, 167

    Google Scholar 

  2. Awhad, V.: A Unified Formal Specification and Analysis of the New Java Memory Models. M. S. Thesis, Michigan Technological Univ. (2002) 168, 179

    Google Scholar 

  3. Blumofe, R.D., Frigo, M., Joerg, C. F., Leiserson, C. E., Randall, K.H.: An Analysis of DAG-consistent Distributed Shared-Memory Algorithms. Proc. ACM SPAA, (1996) 297–308 167

    Google Scholar 

  4. Börger, E.: Why Use Evolving Algebras for Hardware and Software Engineering? In: Bartosek, M., Staudek, J., Wiedermann, J. (eds.): SOFSEM’ 95: 22nd Seminar on Current Trends in Theory and Practice of Informatics. LNCS 1012, Springer-Verlag (1995) 236–271 171, 182

    Google Scholar 

  5. Cenciarelli, P., Knapp, A., Reus, B., Wirsing, M.: ¿From Sequential to Multi-Threaded Java: An Event-Based Operational Semantics. In: Johnson, M. (ed.): Algebraic Methodology and Software Technology. Springer-Verlag (1997) 75–90

    Google Scholar 

  6. Gao, G.R., Sarkar, V.: Location Consistency-A New Memory Model and Cache Consistency Protocol. IEEE Trans. on Comp. 49(8) (2000) 798–813 167, 168, 171

    Article  Google Scholar 

  7. Gharachorloo, K., Lenoski, D., Laudon, J., Gibbons, P., Gupta, A., Hennessy, J.: Memory Consistency and Event Ordering in Scalable Shared-Memory Multiprocessors. Proc. ISCA (1990) 15–26 167

    Google Scholar 

  8. Goetz, B.: Double-Checked Locking: Clever, but Broken. JavaWorld 6(2) (2001) 183

    Google Scholar 

  9. Gontmakher, A., Schuster, A.: Java consistency: Non-operational characterizations for Java memory behavior. ACM Trans. on Comp. Sys. 18(4) (2000) 333–386 183

    Article  Google Scholar 

  10. Goodman, J. R.: Cache Consistency and Sequential Consistency. Technical Report 1006, Computer Science Dept., U. of Wisconsin-Madison (1989) 167

    Google Scholar 

  11. Gosling, J., Joy, B., Steele, G.: The Java Language Specification. Addison-Wesley (1996) 168

    Google Scholar 

  12. Gropp, W., Huss-Lederman, S., Lumsdaine, A., Lusk, E., Nitzberg, N., Saphir, W., Snir, M.: MPI: The Complete Reference. MIT Press (1998) 167

    Google Scholar 

  13. Gurevich, Y., Schulte, W., Wallace, C.: Investigating Java concurrency Using Abstract State Machines. In: Gurevich, Y., Kutter, P. W., Odersky, M., Thiele, L. (eds.): Abstract State Machines: Theory and Applications. LNCS 1912. Springer-Verlag (2000) 151–176 168, 183

    Chapter  Google Scholar 

  14. Hagersten, E., Landin, A., Haridi, S.: DDM-A Cache Only Memory Architecture. IEEE Computer 25(9) (1992) 44–54 168

    Google Scholar 

  15. Holub, A.: Warning! Threading in a Multiprocessor World. JavaWorld 6(2) (2001) 183

    Google Scholar 

  16. Joe, T.: COMA-F: A Non-Hierarchical Cache Only Memory Architecture. Ph.D. Thesis, Stanford Univ. (1995) 168

    Google Scholar 

  17. Kutter, P.W.: Montages-Engineering of Programming Languages. Ph.D. Thesis, Eidgenössische Technische Hochschule Zürich (2002) 183

    Google Scholar 

  18. Lamport, L.: How to Make a Multiprocessor Computer that Correctly Executes Multiprocess Programs. IEEE Transactions on Computers C-28(9) (1979) 690–691 167

    Article  Google Scholar 

  19. Maessen, J.-W., Arvind Shen, X.: Improving the Java Memory Model Using CRF. Proc. OOPSLA (2000) 1–12 168, 171

    Google Scholar 

  20. Manson, J., Pugh, W.: Multithreaded Semantics for Java. CS Technical Report 4215, Univ. of Maryland (2001) 168, 169

    Google Scholar 

  21. Pugh, W.: Fixing the Java Memory Model. Proc. ACM Java Grande (1999) 168

    Google Scholar 

  22. Roychoudhury, A., Mitra, T.: Specifying Multithreaded Java Semantics for Program Verification. Proc. ICSE (2002) 183

    Google Scholar 

  23. Shen, X., Arvind: Specification of Memory Models and Design of Provably Correct Cache Coherent Protocols. CSG Memo 398, Laboratory for Computer Science, MIT (1997) 171

    Google Scholar 

  24. Shen, X., Arvind Rudolph, L.: Commit-Reconcile & Fences (CRF): A New Memory Model for Architects and Compiler Writers. Proc. ISCA (1999) 150–161 167, 168

    Google Scholar 

  25. Stärk, R., Schmid, J., Börger, E.: Java and the Java Virtual Machine: Definition, Verification, Validation. Springer-Verlag (2001) 183

    Google Scholar 

  26. Wallace, C., Tremblay, G., Amaral, J.N.: On the Tamability of the Location Consistency Memory Model. Proc. PDPTA (2002) 172

    Google Scholar 

  27. Wallace, C., Tremblay, G., Amaral, J.N.: An Abstract State Machine Specification and Verification of the Location Consistency Memory Model and Cache Protocol. J. Universal Computer Science 7(11) (2001) 1088–1112 172

    Google Scholar 

  28. XASM Home Page. http://www.xasm.org/’ 183 ∔bitem {YanGopLin:02}Yang, Y., Gopalakrishnan, G., Lindstrom, G.: Formalizing the Java Memory Model for Multithreaded Program Correctness and Optimization. Technical Report UUCS-02-011, Univ. of Utah.

  29. Yang, Y., Gopalakrishnan, G., Lindstrom, G.: Analyzing the CRF Java Memory Model. Proc. Asia-Pacific Software Engineering Conference (2001) 21–28 183

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2003 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Awhad, V., Wallace, C. (2003). A Unified Formal Specification and Analysis of the New Java Memory Models. In: Börger, E., Gargantini, A., Riccobene, E. (eds) Abstract State Machines 2003. ASM 2003. Lecture Notes in Computer Science, vol 2589. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-36498-6_9

Download citation

  • DOI: https://doi.org/10.1007/3-540-36498-6_9

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-00624-4

  • Online ISBN: 978-3-540-36498-6

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics