skip to main content
article

Taming release-acquire consistency

Published:11 January 2016Publication History
Skip Abstract Section

Abstract

We introduce a strengthening of the release-acquire fragment of the C11 memory model that (i) forbids dubious behaviors that are not observed in any implementation; (ii) supports fence instructions that restore sequential consistency; and (iii) admits an equivalent intuitive operational semantics based on point-to-point communication. This strengthening has no additional implementation cost: it allows the same local optimizations as C11 release and acquire accesses, and has exactly the same compilation schemes to the x86-TSO and Power architectures. In fact, the compilation to Power is complete with respect to a recent axiomatic model of Power; that is, the compiled program exhibits exactly the same behaviors as the source one. Moreover, we provide criteria for placing enough fence instructions to ensure sequential consistency, and apply them to an efficient RCU implementation.

References

  1. P. A. Abdulla, S. Aronis, M. F. Atig, B. Jonsson, C. Leonardsson, and K. Sagonas. Stateless model checking for TSO and PSO. In Tools and Algorithms for the Construction and Analysis of Systems, TACAS 2015, volume 9035 of LNCS, pages 353–367. Springer, 2015.Google ScholarGoogle Scholar
  2. P. A. Abdulla, M. F. Atig, and N. T. Phong. The best of both worlds: Trading efficiency and optimality in fence insertion for TSO. In ESOP 2015: 24th European Symposium on Programming, volume 9032 of LNCS, pages 308–332. Springer, 2015. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. M. Ahamad, G. Neiger, J. Burns, P. Kohli, and P. Hutto. Causal memory: definitions, implementation, and programming. Distributed Computing, 9(1):37–49, 1995.Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. J. Alglave, L. Maranget, and M. Tautschnig. Herding cats: Modelling, simulation, testing, and data mining for weak memory. ACM Trans. Program. Lang. Syst., 36(2):7:1–7:74, July 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. J. Barnat, L. Brim, and V. Havel. LTL model checking of parallel programs with under-approximated TSO memory model. In 13th International Conference on Application of Concurrency to System Design, ACSD’13, pages 51–59, July 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. M. Batty, S. Owens, S. Sarkar, P. Sewell, and T. Weber. Mathematizing C++ concurrency. In 38th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL ’11, pages 55–66. ACM, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. M. Batty, K. Memarian, S. Owens, S. Sarkar, and P. Sewell. Clarifying and compiling C/C++ concurrency: From C++11 to POWER. In 39th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL ’12, pages 509–520. ACM, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. M. Batty, K. Memarian, K. Nienhuis, J. Pichon-Pharabod, and P. Sewell. The problem of programming language concurrency semantics. In 24th European Symposium on Programming (ESOP 2015), volume 9032 of LNCS, pages 283–307. Springer, 2015.Google ScholarGoogle ScholarCross RefCross Ref
  9. A. Bouajjani, R. Meyer, and E. Möhlmann. Deciding robustness against total store ordering. In Automata, Languages and Programming, volume 6756 of LNCS, pages 428–440. Springer, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. A. Bouajjani, E. Derevenetc, and R. Meyer. Checking and enforcing robustness against TSO. In Programming Languages and Systems, volume 7792 of LNCS, pages 533–553. Springer, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. A. Cerone, G. Bernardi, and A. Gotsman. A Framework for Transactional Consistency Models with Atomic Visibility. In 26th International Conference on Concurrency Theory (CONCUR 2015), volume 42 of LIPIcs, pages 58–71. Schloss Dagstuhl–Leibniz-Zentrum fuer Informatik, 2015.Google ScholarGoogle Scholar
  12. A. Dan, Y. Meshman, M. Vechev, and E. Yahav. Effective abstractions for verification under relaxed memory models. In Verification, Model Checking, and Abstract Interpretation, volume 8931 of LNCS, pages 449–466. Springer, 2015.Google ScholarGoogle Scholar
  13. M. Desnoyers, P. E. McKenney, A. S. Stern, M. R. Dagenais, and J. Walpole. User-level implementations of read-copy update. IEEE Trans. Parallel Distrib. Syst., 23(2):375–382, 2012.. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. ISO/IEC 14882:2011. Programming language C++, 2011.Google ScholarGoogle Scholar
  15. ISO/IEC 9899:2011. Programming language C, 2011.Google ScholarGoogle Scholar
  16. S. Jagannathan, V. Laporte, G. Petri, D. Pichardie, and J. Vitek. Atomicity refinement for verified compilation. ACM Trans. Program. Lang. Syst., 36(2):6:1–6:30, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. M. Kuperstein, M. Vechev, and E. Yahav. Partial-coherence abstractions for relaxed memory models. In 32nd ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI ’11, pages 187–198. ACM, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. O. Lahav and V. Vafeiadis. Owicki-gries reasoning for weak memory models. In Automata, Languages, and Programming, ICALP’15, volume 9135 of LNCS, pages 311–323. Springer, 2015.Google ScholarGoogle Scholar
  19. L. Lamport. How to make a multiprocessor computer that correctly executes multiprocess programs. IEEE Trans. Computers, 28(9):690– 691, 1979. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. A. Linden and P. Wolper. An automata-based symbolic approach for verifying programs on relaxed memory models. In Model Checking Software, volume 6349 of LNCS, pages 212–226. Springer, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. R. J. Lipton and J. S. Sandberg. PRAM: A scalable shared memory. Technical report, Technical Report CS-TR-180-88, Princeton University, 1988.Google ScholarGoogle Scholar
  22. W. Mansky and E. L. Gunter. Verifying optimizations for concurrent programs. In First International Workshop on Rewriting Techniques for Program Transformations and Evaluation, WPTE 2014, volume 40 of OASICS, pages 15–26. Schloss Dagstuhl - Leibniz-Zentrum fuer Informatik, 2014.Google ScholarGoogle Scholar
  23. L. Maranget, S. Sarkar, and P. Sewell. A tutorial introduction to the ARM and POWER relaxed memory models. http://www.cl.cam.ac.uk/˜pes20/ppc-supplemental/test7.pdf, 2012.Google ScholarGoogle Scholar
  24. S. Owens. Reasoning about the implementation of concurrency abstractions on x86-TSO. In ECOOP 2010: 24th European Conference on Object-Oriented Programming, volume 6183 of LNCS, pages 478– 503. Springer, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. S. Owens, S. Sarkar, and P. Sewell. A better x86 memory model: x86-TSO. In TPHOLs 2009, volume 5674 of LNCS, pages 391–407. Springer, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. B. Rajaram, V. Nagarajan, S. Sarkar, and M. Elver. Fast RMWs for TSO: Semantics and implementation. In 34th ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI ’13, pages 61–72. ACM, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. T. Ridge. A rely-guarantee proof system for x86-TSO. In VSTTE 2010, volume 6217 of LNCS, pages 55–70. Springer, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. S. Sarkar, P. Sewell, J. Alglave, L. Maranget, and D. Williams. Understanding POWER multiprocessors. In 32nd ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI ’11, pages 175–186. ACM, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. S. Sarkar, K. Memarian, S. Owens, M. Batty, P. Sewell, L. Maranget, J. Alglave, and D. Williams. Synchronising C/C++ and POWER. In 33rd ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI ’12, pages 311–322. ACM, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. J. Sevcik, V. Vafeiadis, F. Zappa Nardelli, S. Jagannathan, and P. Sewell. CompCertTSO: A verified compiler for relaxed-memory concurrency. J. ACM, 60(3):22, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. D. Shasha and M. Snir. Efficient and correct execution of parallel programs that share memory. ACM Trans. Program. Lang. Syst., 10 (2):282–312, 1988. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. F. Sieczkowski, K. Svendsen, L. Birkedal, and J. Pichon-Pharabod. A separation logic for fictional sequential consistency. In ESOP 2015, volume 9032 of LNCS, pages 736–761. Springer, 2015.Google ScholarGoogle Scholar
  33. SPARC International Inc. The SPARC Architecture Manual: Version 8. Prentice-Hall, Inc., 1992. ISBN 0-13-825001-4. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. R. C. Steinke and G. J. Nutt. A unified theory of shared memory consistency. J. ACM, 51(5):800–849, Sept. 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. J. Tassarotti, D. Dreyer, and V. Vafeiadis. Verifying read-copy-update in a logic for weak memory. In 36th ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI 2015, pages 110–120. ACM, 2015. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. A. Turon, V. Vafeiadis, and D. Dreyer. GPS: Navigating weak memory with ghosts, protocols, and separation. In 2014 ACM International Conference on Object Oriented Programming Systems Languages and Applications, OOPSLA ’14, pages 691–707. ACM, 2014.. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. V. Vafeiadis and F. Zappa Nardelli. Verifying fence elimination optimisations. In 18th International Conference on Static Analysis, SAS’11, volume 6887 of LNCS, pages 146–162. Springer, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. V. Vafeiadis, T. Balabonski, S. Chakraborty, R. Morisset, and F. Zappa Nardelli. Common compiler optimisations are invalid in the C11 memory model and what we can do about it. In 42nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL ’15, pages 209–220. ACM, 2015. Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. J. Wickerson, M. Batty, and A. F. Donaldson. Overhauling SC atomics in C11 and OpenCL. In 43rd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL ’16, 2016. Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. Y. Zhang and X. Feng. An operational approach to happens-before memory model. In 7th International Symposium on Theoretical Aspects of Software Engineering, TASE 2013, pages 121–128. IEEE Computer Society, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Taming release-acquire consistency

                Recommendations

                Comments

                Login options

                Check if you have access through your login credentials or your institution to get full access on this article.

                Sign in

                Full Access

                • Published in

                  cover image ACM SIGPLAN Notices
                  ACM SIGPLAN Notices  Volume 51, Issue 1
                  POPL '16
                  January 2016
                  815 pages
                  ISSN:0362-1340
                  EISSN:1558-1160
                  DOI:10.1145/2914770
                  • Editor:
                  • Andy Gill
                  Issue’s Table of Contents
                  • cover image ACM Conferences
                    POPL '16: Proceedings of the 43rd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages
                    January 2016
                    815 pages
                    ISBN:9781450335492
                    DOI:10.1145/2837614

                  Copyright © 2016 ACM

                  Publisher

                  Association for Computing Machinery

                  New York, NY, United States

                  Publication History

                  • Published: 11 January 2016

                  Check for updates

                  Qualifiers

                  • article

                PDF Format

                View or Download as a PDF file.

                PDF

                eReader

                View online with eReader.

                eReader
                About Cookies On This Site

                We use cookies to ensure that we give you the best experience on our website.

                Learn more

                Got it!