Skip to main content

Formalising Java’s Data Race Free Guarantee

  • Conference paper
Theorem Proving in Higher Order Logics (TPHOLs 2007)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 4732))

Included in the following conference series:

  • 600 Accesses

Abstract

We formalise the data race free (DRF) guarantee provided by Java, as captured by the semi-formal Java Memory Model (JMM) [1] and published in the Java Language Specification [2].The DRF guarantee says that all programs which are correctly synchronised (i.e., free of data races) can only have sequentially consistent behaviours. Such programs can be understood intuitively by programmers. Formalisation has achieved three aims. First, we made definitions and proofs precise, leading to a better understanding; our analysis found several hidden inconsistencies and missing details. Second, the formalisation lets us explore variations and investigate their impact in the proof with the aim of simplifying the model; we found that not all of the anticipated conditions in the JMM definition were actually necessary for the DRF guarantee. This allows us to suggest a quick fix to a recently discovered serious bug [3] without invalidating the DRF guarantee. Finally, the formal definition provides a basis to test concrete examples, and opens the way for future work on JMM-aware logics for concurrent programs.

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

Access this chapter

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Similar content being viewed by others

References

  1. Manson, J., Pugh, W., Adve, S.V.: The Java memory model. In: POPL 2005. Proceedings of the 32nd ACM SIGPLAN-SIGACT symposium on Principles of Programming Languages, pp. 378–391. ACM Press, New York (2005)

    Chapter  Google Scholar 

  2. Gosling, J., Joy, B., Steele, G., Bracha, G.: Memory Model. In: Java(TM) Language Specification, 3rd edn. Java Series, pp. 557–573. Addison-Wesley Professional, Reading (2005)

    Google Scholar 

  3. Cenciarelli, P., Knapp, A., Sibilio, E.: The Java memory model: Operationally, denotationally, axiomatically. In: 16th ESOP (2007)

    Google Scholar 

  4. Adve, S.V., Gharachorloo, K.: Shared memory consistency models: A tutorial. Computer 29(12), 66–76 (1996)

    Article  Google Scholar 

  5. Pugh, W.: The Java memory model is fatally flawed. Concurrency - Practice and Experience 12(6), 445–455 (2000)

    Article  Google Scholar 

  6. Peierls, T., Goetz, B., Bloch, J., Bowbeer, J., Lea, D., Holmes, D.: Java Concurrency in Practice. Addison-Wesley Professional, Reading (2005)

    Google Scholar 

  7. Pugh, W., Manson, J.: Java memory model causality test cases (2004), http://www.cs.umd.edu/~pugh/java/memoryModel/CausalityTestCases.html

  8. Manson, J., Pugh, W., Adve, S.V.: The Java memory model. Special POPL Issue (submitted)

    Google Scholar 

  9. Lamport, L.: Time, clocks, and the ordering of events in a distributed system. Commun. ACM 21(7), 558–565 (1978)

    Article  MATH  Google Scholar 

  10. Adve, S.: The SC- memory model for Java (2004), http://www.cs.uiuc.edu/~sadve/jmm

  11. Wenzel, M.: The Isabelle/Isar reference manual (2005), http://isabelle.in.tum.de/doc/isar-ref.pdf

  12. Adve, S.V., Aggarwal, J.K.: A unified formalization of four shared-memory models. IEEE Trans. Parallel Distrib. Syst. 4(6), 613–624 (1993)

    Article  Google Scholar 

  13. Kawash, J.: Limitations and Capabilities of Weak Memory Consistency Systems. PhD thesis, The University of Calgary (2000)

    Google Scholar 

  14. Roychoudhury, A.: Formal reasoning about hardware and software memory models. In: George, C.W., Miao, H. (eds.) ICFEM 2002. LNCS, vol. 2495, pp. 423–434. Springer, Heidelberg (2002)

    Chapter  Google Scholar 

  15. Bacon, D., et al.: The “double-checked locking is broken” declaration (2001), http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html

  16. Maessen, J.W., Shen, X.: Improving the Java memory model using CRF. In: OOPSLA, pp. 1–12. ACM Press, New York (2000)

    Chapter  Google Scholar 

  17. Saraswat, V., Jagadeesan, R., Michael, M., von Praun, C.: A theory of memory models. In: ACM 2007 SIGPLAN Conference on Principles and Practice of Parallel Computing, ACM, New York (2007)

    Google Scholar 

  18. Manson, J.: The Java memory model. PhD thesis, University of Maryland, College Park (2004)

    Google Scholar 

  19. Ábrahám, E., de Boer, F.S., de Roever, W.P., Steffen, M.: An assertion-based proof system for multithreaded Java. TCS 331(2-3), 251–290 (2005)

    Article  MATH  Google Scholar 

  20. Flanagan, C., Freund, S.N., Qadeer, S., Seshia, S.A.: Modular verification of multithreaded programs. Theor. Comput. Sci. 338(1-3), 153–183 (2005)

    Article  MATH  MathSciNet  Google Scholar 

  21. Moore, J.S., Porter, G.: The apprentice challenge. ACM Trans. Program. Lang. Syst. 24(3), 193–216 (2002)

    Article  Google Scholar 

  22. Flanagan, C., Freund, S.N.: Type-based race detection for Java. In: PLDI, pp. 219–232. ACM Press, New York (2000)

    Chapter  Google Scholar 

  23. Boyapati, C., Rinard, M.: A parameterized type system for race-free Java programs. In: OOPSLA, pp. 56–69. ACM Press, New York (2001)

    Chapter  Google Scholar 

  24. Huisman, M., Grigore, R., Haack, C., Hurlin, C., Kiniry, J., Petri, G., Poll, E.: Report on thread-modular verification. Mobius project deliverable D3.3 (2007), available from http://mobius.inria.fr

  25. Microsoft: Standard ECMA-335 Common Language Infrastructure (CLI) (2005)

    Google Scholar 

  26. Burckhardt, S., Alur, R., Martin, M.M.K.: Bounded model checking of concurrent data types on relaxed memory models: A case study. In: Ball, T., Jones, R.B. (eds.) CAV 2006. LNCS, vol. 4144, pp. 489–502. Springer, Heidelberg (2006)

    Chapter  Google Scholar 

  27. Burckhardt, S., Alur, R., Martin, M.M.K.: CheckFence: Checking consistency of concurrent data types on relaxed memory models. In: PLDI, San Diego, California, USA, ACM Press, New York (2007)

    Google Scholar 

  28. Manson, J., Pugh, W.: Semantics of multithreaded Java. Technical Report CS-TR-4215, Dept. of Computer Science, University of Maryland, College Park (2001)

    Google Scholar 

  29. Yang, Y., Gopalakrishnan, G., Lindstrom, G.: UMM: an operational memory model specification framework with integrated model checking capability: Research articles. Concurr. Comput.: Pract. Exper. 17(5-6), 465–487 (2005)

    Article  Google Scholar 

  30. Yang, Y., Gopalakrishnan, G., Lindstrom, G.: Memory-model-sensitive data race analysis. In: Davies, J., Schulte, W., Barnett, M. (eds.) ICFEM 2004. LNCS, vol. 3308, pp. 30–45. Springer, Heidelberg (2004)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Klaus Schneider Jens Brandt

Rights and permissions

Reprints and permissions

Copyright information

© 2007 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Aspinall, D., Ševčík, J. (2007). Formalising Java’s Data Race Free Guarantee. In: Schneider, K., Brandt, J. (eds) Theorem Proving in Higher Order Logics. TPHOLs 2007. Lecture Notes in Computer Science, vol 4732. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-74591-4_4

Download citation

  • DOI: https://doi.org/10.1007/978-3-540-74591-4_4

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-74590-7

  • Online ISBN: 978-3-540-74591-4

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy