Skip to main content

Advertisement

SpringerLink
Book cover

European Symposium on Programming

ESOP 2020: Programming Languages and Systems pp 599–625Cite as

  1. Home
  2. Programming Languages and Systems
  3. Conference paper
Modular Relaxed Dependencies in Weak Memory Concurrency

Modular Relaxed Dependencies in Weak Memory Concurrency

  • Marco Paviotti9,10,
  • Simon Cooksey10,
  • Anouk Paradis11,
  • Daniel Wright10,
  • Scott Owens10 &
  • …
  • Mark Batty10 
  • Conference paper
  • Open Access
  • First Online: 18 April 2020
  • 8606 Accesses

  • 16 Citations

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

Abstract

We present a denotational semantics for weak memory concurrency that avoids thin-air reads, provides data-race free programs with sequentially consistent semantics (DRF-SC), and supports a compositional refinement relation for validating optimisations. Our semantics identifies false program dependencies that might be removed by compiler optimisation, and leaves in place just the dependencies necessary to rule out thin-air reads. We show that our dependency calculation can be used to rule out thin-air reads in any axiomatic concurrency model, in particular C++. We present a tool that automatically evaluates litmus tests, show that we can augment C++ to fix the thin-air problem, and we prove that our augmentation is compatible with the previously used compilation mappings over key processor architectures. We argue that our dependency calculation offers a practical route to fixing the longstanding problem of thin-air reads in the C++ specification.

Keywords

  • Thin-air problem
  • Weak memory concurrency
  • Compiler Optimisations
  • Denotational Semantics
  • Compositionality

This work was funded by EPSRC Grants EP/M017176/1, EP/R020566/1 and EP/S028129/1, the Lloyds Register Foundation, and the Royal Academy of Engineering.

Download conference paper PDF

References

  1. Adve, S.V., Hill, M.D.: Weak ordering — a new definition. In: ISCA (1990)

    Google Scholar 

  2. Alglave, J., Maranget, L., McKenney, P.E., Parri, A., Stern, A.: Frightening small children and disconcerting grown-ups: Concurrency in the linux kernel. In: ASPLOS (2018)

    Google Scholar 

  3. Alglave, J., Maranget, L., Tautschnig, M.: Herding cats: modelling, simulation, testing, and data-mining for weak memory. In: PLDI (2014)

    Google Scholar 

  4. Batty, M.: The C11 and C++11 Concurrency Model. Ph.D. thesis, University of Cambridge, UK (2015)

    Google Scholar 

  5. Batty, M., Cooksey, S., Owens, S., Paradis, A., Paviotti, M., Wright, D.: Modular Relaxed Dependencies: A new approach to the Out-Of-Thin-Air Problem (2019), http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1780r0.html

  6. Batty, M., Donaldson, A.F., Wickerson, J.: Overhauling SC atomics in C11 and opencl. In: POPL (2016)

    Google Scholar 

  7. Batty, M., Memarian, K., Nienhuis, K., Pichon-Pharabod, J., Sewell, P.: The problem of programming language concurrency semantics. In: ESOP (2015)

    Google Scholar 

  8. Batty, M., Owens, S., Sarkar, S., Sewell, P., Weber, T.: Mathematizing C++ concurrency. In: POPL (2011)

    Google Scholar 

  9. Benton, N., Hur, C.: Step-indexing: The good, the bad and the ugly. In: Modelling, Controlling and Reasoning About State, 29.08. - 03.09.2010 (2010)

    Google Scholar 

  10. Boehm, H.J., Adve, S.V.: Foundations of the C++ concurrency model. In: PLDI (2008)

    Google Scholar 

  11. Chakraborty, S., Vafeiadis, V.: Grounding thin-air reads with event structures. In: POPL (2019)

    Google Scholar 

  12. Dodds, M., Batty, M., Gotsman, A.: Compositional verification of compiler optimisations on relaxed memory. In: ESOP (2018)

    Google Scholar 

  13. ISO/IEC JTC 1/SC 22 Programming languages, their environments and system software interfaces: ISO/IEC 14882:2017 Programming languages — C++ (2017)

    Google Scholar 

  14. Jeffrey, A., Riely, J.: On thin air reads towards an event structures model of relaxed memory. In: LICS (2016)

    Google Scholar 

  15. Jeffrey, A., Riely, J.: On thin air reads: Towards an event structures model of relaxed memory. Logical Methods in Computer Science 15(1) (2019)

    Google Scholar 

  16. Kang, J., Hur, C.K., Lahav, O., Vafeiadis, V., Dreyer, D.: A promising semantics for relaxed-memory concurrency. In: POPL (2017)

    Google Scholar 

  17. Kavanagh, R., Brookes, S.: A denotational semantics for SPARC TSO. MFPS (2018)

    Google Scholar 

  18. Lahav, O., Vafeiadis, V., Kang, J., Hur, C., Dreyer, D.: Repairing sequential consistency in C/C++11. In: PLDI (2017)

    Google Scholar 

  19. Leroy, X., Grall, H.: Coinductive big-step operational semantics. Inf. Comput. (2009)

    Google Scholar 

  20. Lochbihler, A.: Making the java memory model safe. ACM Trans. Program. Lang. Syst. 35(4), 12:1–12:65 (2013). https://doi.org/10.1145/2518191

  21. Manson, J., Pugh, W., Adve, S.V.: The Java Memory Model. In: POPL (2005)

    Google Scholar 

  22. McKenney, P.E., Jeffrey, A., Sezgin, A., Tye, T.: Out-of-Thin-Air Execution is Vacuous (2016), http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0422r0.html

  23. Michalis Kokologiannakis, Azalea Raad, V.V.: Model checking for weakly consistent libraries. In: PLDI (2019)

    Google Scholar 

  24. Owens, S., Myreen, M.O., Kumar, R., Tan, Y.K.: Functional big-step semantics. In: Programming Languages and Systems - 25th European Symposium on Programming, ESOP 2016, Held as Part of the European Joint Conferences on Theory and Practice of Software, ETAPS 2016, Eindhoven, The Netherlands, April 2-8, 2016, Proceedings (2016)

    Google Scholar 

  25. Pichon-Pharabod, J., Sewell, P.: A concurrency semantics for relaxed atomics that permits optimisation and avoids thin-air executions. In: POPL (2016)

    Google Scholar 

  26. Podkopaev, A., Lahav, O., Vafeiadis, V.: Bridging the gap between programming languages and hardware weak memory models. PACMPL (POPL) (2019)

    Google Scholar 

  27. Pugh, W.: Java causality tests. http://www.cs.umd.edu/~pugh/java/memoryModel/CausalityTestCases.html (2004), accessed: 2018-11-17

  28. Riely, J., Jagadeesan, R., Jeffery, A.: private correspondence (2020)

    Google Scholar 

  29. Ševčík, J.: Program transformations in weak memory models. Ph.D. thesis, University of Edinburgh, UK (2009)

    Google Scholar 

  30. Ševčík, J., Aspinall, D.: On validity of program transformations in the java memory model. In: ECOOP (2008)

    Google Scholar 

  31. Streicher, T.: Domain-theoretic foundations of functional programming (01 2006)

    Google Scholar 

  32. Wickerson, J., Batty, M., Sorensen, T., Constantinides, G.A.: Automatically comparing memory consistency models. In: POPL (2017)

    Google Scholar 

  33. Winskel, G.: Event structures. In: Petri Nets: Central Models and Their Properties, Advances in Petri Nets 1986, Part II, Proceedings of an Advanced Course, Bad Honnef, 8.-19. September 1986 (1986)

    Google Scholar 

  34. Winskel, G.: An introduction to event structures (1989)

    Google Scholar 

Download references

Author information

Authors and Affiliations

  1. Imperial College London, London, UK

    Marco Paviotti

  2. University of Kent, Canterbury, UK

    Marco Paviotti, Simon Cooksey, Daniel Wright, Scott Owens & Mark Batty

  3. ETH Zurich, Zürich, Switzerland

    Anouk Paradis

Authors
  1. Marco Paviotti
    View author publications

    You can also search for this author in PubMed Google Scholar

  2. Simon Cooksey
    View author publications

    You can also search for this author in PubMed Google Scholar

  3. Anouk Paradis
    View author publications

    You can also search for this author in PubMed Google Scholar

  4. Daniel Wright
    View author publications

    You can also search for this author in PubMed Google Scholar

  5. Scott Owens
    View author publications

    You can also search for this author in PubMed Google Scholar

  6. Mark Batty
    View author publications

    You can also search for this author in PubMed Google Scholar

Corresponding author

Correspondence to Marco Paviotti .

Editor information

Editors and Affiliations

  1. ETH Zurich, Zurich, Switzerland

    Prof. Dr. Peter Müller

Rights and permissions

Open Access This chapter is licensed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license and indicate if changes were made.

The images or other third party material in this chapter are included in the chapter's Creative Commons license, unless indicated otherwise in a credit line to the material. If material is not included in the chapter's Creative Commons license and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder.

Reprints and Permissions

Copyright information

© 2020 The Author(s)

About this paper

Verify currency and authenticity via CrossMark

Cite this paper

Paviotti, M., Cooksey, S., Paradis, A., Wright, D., Owens, S., Batty, M. (2020). Modular Relaxed Dependencies in Weak Memory Concurrency. In: Müller, P. (eds) Programming Languages and Systems. ESOP 2020. Lecture Notes in Computer Science(), vol 12075. Springer, Cham. https://doi.org/10.1007/978-3-030-44914-8_22

Download citation

  • .RIS
  • .ENW
  • .BIB
  • DOI: https://doi.org/10.1007/978-3-030-44914-8_22

  • Published: 18 April 2020

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-44913-1

  • Online ISBN: 978-3-030-44914-8

  • eBook Packages: Computer ScienceComputer Science (R0)

Share this paper

Anyone you share the following link with will be able to read this content:

Sorry, a shareable link is not currently available for this article.

Provided by the Springer Nature SharedIt content-sharing initiative

  • The European Joint Conferences on Theory and Practice of Software.

    Published in cooperation with

    http://www.etaps.org/

Over 10 million scientific documents at your fingertips

Switch Edition
  • Academic Edition
  • Corporate Edition
  • Home
  • Impressum
  • Legal information
  • Privacy statement
  • California Privacy Statement
  • How we use cookies
  • Manage cookies/Do not sell my data
  • Accessibility
  • FAQ
  • Contact us
  • Affiliate program

Not affiliated

Springer Nature

© 2023 Springer Nature Switzerland AG. Part of Springer Nature.