Advertisement

Generative Operational Semantics for Relaxed Memory Models

  • Radha Jagadeesan
  • Corin Pitcher
  • James Riely
Part of the Lecture Notes in Computer Science book series (LNCS, volume 6012)

Abstract

The specification of the Java Memory Model (jmm) is phrased in terms of acceptors of execution sequences rather than the standard generative view of operational semantics. This creates a mismatch with language-based techniques, such as simulation arguments and proofs of type safety.

We describe a semantics for the jmm using standard programming language techniques that captures its full expressivity. For data-race-free programs, our model coincides with the jmm. For lockless programs, our model is more expressive than the jmm. The stratification properties required to avoid causality cycles are derived, rather than mandated in the style of the jmm.

The jmm is arguably non-canonical in its treatment of the interaction of data races and locks as it fails to validate roach-motel reorderings and various peephole optimizations. Our model differs from the jmm in these cases. We develop a theory of simulation and use it to validate the legality of the above optimizations in any program context.

Keywords

Memory Model Operational Semantic Data Race Sequential Consistency Evaluation Context 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

References

  1. Adve, S.V., Gharachorloo, K.: Shared memory consistency models: A tutorial. Computer 29(12), 66–76 (1996)CrossRefGoogle Scholar
  2. Aspinall, D., Sevcík, J.: Formalising Java’s data race free guarantee. In: Schneider, K., Brandt, J. (eds.) TPHOLs 2007. LNCS, vol. 4732, pp. 22–37. Springer, Heidelberg (2007)CrossRefGoogle Scholar
  3. Boehm, H.-J.: Threads cannot be implemented as a library. In: PLDI 2005, pp. 261–268. ACM, New York (2005)CrossRefGoogle Scholar
  4. Boehm, H.-J., Adve, S.V.: Foundations of the C++ concurrency memory model. In: PLDI 2008, pp. 68–78 (2008)Google Scholar
  5. Boudol, G., Petri, G.: Relaxed memory models: an operational approach. In: POPL, pp. 392–403 (2009)Google Scholar
  6. Bronevetsky, G., de Supinski, B.R.: Complete formal specification of the OpenMP memory model. Int. J. Parallel Program. 35(4), 335–392 (2007)MATHCrossRefGoogle Scholar
  7. Burckhardt, S., Musuvath, M., Singh, V.: Verifying compiler transformations for concurrent programs. MSR-TR-2008-171 (2008)Google Scholar
  8. Cenciarelli, P., Knapp, A., Sibilio, E.: The Java memory model: Operationally, denotationally, axiomatically. In: De Nicola, R. (ed.) ESOP 2007. LNCS, vol. 4421, pp. 331–346. Springer, Heidelberg (2007)CrossRefGoogle Scholar
  9. Flanagan, C., Sabry, A., Duba, B.F., Felleisen, M.: The essence of compiling with continuations. In: PLDI 1993, vol. 28(6), pp. 237–247. ACM Press, New York (1993)CrossRefGoogle Scholar
  10. Hangal, S., Vahia, D., Manovit, C., Lu, J.-Y.J.: TSOtool: A program for verifying memory systems using the memory consistency model. In: ISCA 2004, p. 114. IEEE, Los Alamitos (2004)Google Scholar
  11. Igarashi, A., Pierce, B.C., Wadler, P.: Featherweight Java: a minimal core calculus for Java and GJ. ACM Trans. Programming Languages and Systems 23(3), 396–450 (2001)CrossRefGoogle Scholar
  12. Kamil, A., Su, J., Yelick, K.A.: Making sequential consistency practical in Titanium. In: SC, p. 15. IEEE, Los Alamitos (2005)Google Scholar
  13. Lamport, L.: How to make a multiprocessor computer that correctly executes multiprocess program. IEEE Trans. Comput. 28(9), 690–691 (1979)MATHCrossRefGoogle Scholar
  14. Lea, D.: The JSR-133 cookbook for compiler writers (2008), http://gee.cs.oswego.edu/dl/jmm/cookbook.html (Last modified: April 2008)
  15. Luchangco, V.M.: Memory consistency models for high-performance distributed computing. PhD thesis, MIT (2001)Google Scholar
  16. Manson, J., Pugh, W., Adve, S.V.: The Java memory model. In: POPL 2005, pp. 378–391. ACM Press, New York (2005)CrossRefGoogle Scholar
  17. Milner, R.: The polyadic pi-calculus: a tutorial. Technical report, Logic and Algebra of Specification (1991)Google Scholar
  18. Odersky, M., Spoon, L., Venners, B.: Programming in Scala: A Comprehensive Step-by-step Guide. Artima (2008)Google Scholar
  19. Saraswat, V.A.: Concurrent constraint-based memory machines: A framework for Java memory models. In: Maher, M.J. (ed.) ASIAN 2004. LNCS, vol. 3321, pp. 494–508. Springer, Heidelberg (2004)Google Scholar
  20. Saraswat, V.A., Jagadeesan, R., Michael, M.M., von Praun, C.: A theory of memory models. In: PPOPP, pp. 161–172. ACM, New York (2007)CrossRefGoogle Scholar
  21. Sarkar, S., Sewell, P., Nardelli, F.Z., Owens, S., Ridge, T., Braibant, T., Myreen, M.O., Alglave, J.: The semantics of x86-CC multiprocessor machine code. In: POPL, pp. 379–391 (2009)Google Scholar
  22. Sevcík, J.: Program Transformations in Weak Memory Models. PhD thesis, Laboratory for Foundations of Computer Science, University of Edinburgh (2008)Google Scholar
  23. Sevcík, J., Aspinall, D.: On validity of program transformations in the Java memory model. In: Vitek, J. (ed.) ECOOP 2008. LNCS, vol. 5142, pp. 27–51. Springer, Heidelberg (2008)CrossRefGoogle Scholar
  24. Steinke, R.C., Nutt, G.J.: A unified theory of shared memory consistency. J. ACM 51(5), 800–849 (2004)CrossRefMathSciNetGoogle Scholar
  25. Yelick, K., Bonachea, D., Wallace, C.: A proposal for a UPC memory consistency model, v1.1. Technical Report LBNL-54983, Lawrence Berkeley National Lab (2004)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2010

Authors and Affiliations

  • Radha Jagadeesan
    • 1
  • Corin Pitcher
    • 1
  • James Riely
    • 1
  1. 1.School of ComputingDePaul University 

Personalised recommendations