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.
- 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 Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Cross Ref
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
- 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 Scholar
- 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 Scholar
Digital Library
- ISO/IEC 14882:2011. Programming language C++, 2011.Google Scholar
- ISO/IEC 9899:2011. Programming language C, 2011.Google Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
- L. Lamport. How to make a multiprocessor computer that correctly executes multiprocess programs. IEEE Trans. Computers, 28(9):690– 691, 1979. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- R. J. Lipton and J. S. Sandberg. PRAM: A scalable shared memory. Technical report, Technical Report CS-TR-180-88, Princeton University, 1988.Google Scholar
- 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 Scholar
- 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 Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- T. Ridge. A rely-guarantee proof system for x86-TSO. In VSTTE 2010, volume 6217 of LNCS, pages 55–70. Springer, 2010. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
- SPARC International Inc. The SPARC Architecture Manual: Version 8. Prentice-Hall, Inc., 1992. ISBN 0-13-825001-4. Google Scholar
Digital Library
- R. C. Steinke and G. J. Nutt. A unified theory of shared memory consistency. J. ACM, 51(5):800–849, Sept. 2004. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
Index Terms
Taming release-acquire consistency
Recommendations
Optimal stateless model checking under the release-acquire semantics
We present a framework for the efficient application of stateless model checking (SMC) to concurrent programs running under the Release-Acquire (RA) fragment of the C/C++11 memory model. Our approach is based on exploring the possible program orders, ...
Taming release-acquire consistency
POPL '16: Proceedings of the 43rd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming LanguagesWe 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 ...
GPS$$+$$+: Reasoning About Fences and Relaxed Atomics
In order to support efficient compilation to modern architectures, mainstream programming languages, such as C/C$$++$$++ and Java, have adopted weak (or relaxed) memory models. According to these weak memory models, multithreaded programs are allowed to ...






Comments