Abstract
Liveness properties, such as termination, of even the simplest shared-memory concurrent programs under sequential consistency typically require some fairness assumptions about the scheduler. Under weak memory models, we observe that the standard notions of thread fairness are insufficient, and an additional fairness property, which we call memory fairness, is needed. In this paper, we propose a uniform definition for memory fairness that can be integrated into any declarative memory model enforcing acyclicity of the union of the program order and the reads-from relation. For the well-known models, SC, x86-TSO, RA, and StrongCOH, that have equivalent operational and declarative presentations, we show that our declarative memory fairness condition is equivalent to an intuitive model-specific operational notion of memory fairness, which requires the memory system to fairly execute its internal propagation steps. Our fairness condition preserves the correctness of local transformations and the compilation scheme from RC11 to x86-TSO, and also enables the first formal proofs of termination of mutual exclusion lock implementations under declarative weak memory models.
Supplemental Material
- Jade Alglave, Luc Maranget, Paul E. McKenney, Andrea Parri, and Alan S. Stern. 2018. Frightening Small Children and Disconcerting Grown-ups: Concurrency in the Linux Kernel. In ASPLOS 2018. ACM, 405–418. https://doi.org/10.1145/3173162.3177156 Google Scholar
Digital Library
- Jade Alglave, Luc Maranget, and Michael Tautschnig. 2014. Herding Cats: Modelling, Simulation, Testing, and Data Mining for Weak Memory. ACM Trans. Program. Lang. Syst., 36, 2 (2014), Article 7, July, 74 pages. issn:0164-0925 https://doi.org/10.1145/2627752 Google Scholar
Digital Library
- Mark Batty, Kayvan Memarian, Scott Owens, Susmit Sarkar, and Peter Sewell. 2012. Clarifying and Compiling C/C++ Concurrency: From C++11 to POWER. In POPL. ACM, New York, NY, USA. 509–520. isbn:9781450310833 https://doi.org/10.1145/2103656.2103717 Google Scholar
Digital Library
- Mark Batty, Scott Owens, Susmit Sarkar, Peter Sewell, and Tjark Weber. 2011. Mathematizing C++ Concurrency. In POPL. ACM, New York, NY, USA. 55–66. isbn:9781450304900 https://doi.org/10.1145/1926385.1926394 Google Scholar
Digital Library
- John Bender and Jens Palsberg. 2019. A Formalization of Java’s Concurrent Access Modes. Proc. ACM Program. Lang., 3, OOPSLA (2019), Article 142, Oct., 28 pages. https://doi.org/10.1145/3360568 Google Scholar
Digital Library
- Ahmed Bouajjani, Egor Derevenetc, and Roland Meyer. 2013. Checking and Enforcing Robustness Against TSO. In ESOP. Springer-Verlag, Berlin, Heidelberg. 533–553. isbn:978-3-642-37035-9 https://doi.org/10.1007/978-3-642-37036-6_29 Google Scholar
Digital Library
- Ahmed Bouajjani, Constantin Enea, and Jad Hamza. 2014. Verifying Eventual Consistency of Optimistic Replication Systems. In POPL. ACM, New York, NY, USA. 285–296. isbn:9781450325448 https://doi.org/10.1145/2535838.2535877 Google Scholar
Digital Library
- Ahmed Bouajjani, Constantin Enea, Suha Orhun Mutluergil, and Serdar Tasiran. 2018. Reasoning About TSO Programs Using Reduction and Abstraction. In CAV. Springer International Publishing, Cham. 336–353. isbn:978-3-319-96142-2 https://doi.org/10.1007/978-3-319-96142-2_21 Google Scholar
- Ahmed Bouajjani, Roland Meyer, and Eike Möhlmann. 2011. Deciding Robustness against Total Store Ordering. In ICALP. Springer Berlin Heidelberg, Berlin, Heidelberg. 428–440. isbn:978-3-642-22012-8 https://doi.org/10.1007/978-3-642-22012-8_34 Google Scholar
Cross Ref
- Andrea Cerone, Giovanni Bernardi, and Alexey Gotsman. 2015. A Framework for Transactional Consistency Models with Atomic Visibility. In CONCUR. Schloss Dagstuhl–Leibniz-Zentrum fuer Informatik, Dagstuhl, Germany. 58–71. isbn:978-3-939897-91-0 issn:1868-8969 https://doi.org/10.4230/LIPIcs.CONCUR.2015.58 Google Scholar
Cross Ref
- Milind Chabbi, Michael Fagan, and John Mellor-Crummey. 2015. High Performance Locks for Multi-Level NUMA Systems. In PPoPP. ACM, New York, NY, USA. 215–226. isbn:9781450332057 https://doi.org/10.1145/2688500.2688503 Google Scholar
Digital Library
- Soham Chakraborty and Viktor Vafeiadis. 2019. Grounding thin-air reads with event structures. Proc. ACM Program. Lang., 3, POPL (2019), 70:1–70:28. https://doi.org/10.1145/3290383 Google Scholar
Digital Library
- Egor Derevenetc and Roland Meyer. 2014. Robustness against Power is PSpace-complete. In ICALP. Springer, Berlin, Heidelberg. 158–170. isbn:978-3-662-43951-7 https://doi.org/10.1007/978-3-662-43951-7_14 Google Scholar
Cross Ref
- Stephen Dolan, KC Sivaramakrishnan, and Anil Madhavapeddy. 2018. Bounding Data Races in Space and Time. In PLDI. ACM, New York, NY, USA. 242–255. isbn:9781450356985 https://doi.org/10.1145/3192366.3192421 Google Scholar
Digital Library
- Shaked Flur, Kathryn E. Gray, Christopher Pulte, Susmit Sarkar, Ali Sezgin, Luc Maranget, Will Deacon, and Peter Sewell. 2016. Modelling the ARMv8 Architecture, Operationally: Concurrency and ISA. In POPL. ACM, New York, NY, USA. 608–621. isbn:9781450335492 https://doi.org/10.1145/2837614.2837615 Google Scholar
Digital Library
- Nissim Francez. 1986. Fairness. Springer. isbn:978-3-540-96235-9 https://doi.org/10.1007/978-1-4612-4886-6 Google Scholar
Cross Ref
- Alexey Gotsman and Sebastian Burckhardt. 2017. Consistency Models with Global Operation Sequencing and their Composition. In DISC. Schloss Dagstuhl–Leibniz-Zentrum fuer Informatik, Dagstuhl, Germany. 23:1–23:16. isbn:978-3-95977-053-8 issn:1868-8969 https://doi.org/10.4230/LIPIcs.DISC.2017.23 Google Scholar
Cross Ref
- Radha Jagadeesan, Alan Jeffrey, and James Riely. 2020. Pomsets with preconditions: A simple model of relaxed memory. Proc. ACM Program. Lang., 4, OOPSLA (2020), 194:1–194:30. https://doi.org/10.1145/3428262 Google Scholar
Digital Library
- Jan-Oliver Kaiser, Hoang-Hai Dang, Derek Dreyer, Ori Lahav, and Viktor Vafeiadis. 2017. Strong Logic for Weak Memory: Reasoning About Release-Acquire Consistency in Iris. In ECOOP. Schloss Dagstuhl–Leibniz-Zentrum fuer Informatik, Dagstuhl, Germany. 17:1–17:29. isbn:978-3-95977-035-4 issn:1868-8969 https://doi.org/10.4230/LIPIcs.ECOOP.2017.17 Google Scholar
- Jeehoon Kang, Chung-Kil Hur, Ori Lahav, Viktor Vafeiadis, and Derek Dreyer. 2017. A Promising Semantics for Relaxed-Memory Concurrency. In POPL. ACM, New York, NY, USA. 175–189. isbn:9781450346603 https://doi.org/10.1145/3009837.3009850 Google Scholar
Digital Library
- Michalis Kokologiannakis, Ori Lahav, Konstantinos Sagonas, and Viktor Vafeiadis. 2017. Effective Stateless Model Checking for C/C++ Concurrency. Proc. ACM Program. Lang., 2, POPL (2017), Article 17, Dec., 32 pages. issn:2475-1421 https://doi.org/10.1145/3158105 Google Scholar
Digital Library
- Michalis Kokologiannakis, Azalea Raad, and Viktor Vafeiadis. 2019. Model Checking for Weakly Consistent Libraries. In PLDI 2019. ACM, New York, NY, USA. 96–110. isbn:9781450367127 https://doi.org/10.1145/3314221.3314609 Google Scholar
Digital Library
- Michalis Kokologiannakis and Viktor Vafeiadis. 2021. GenMC: A Model Checker for Weak Memory Models. In CAV 2021 (LNCS, Vol. 12759). Springer, 427–440. https://doi.org/10.1007/978-3-030-81685-8_20 Google Scholar
Cross Ref
- Ori Lahav, Nick Giannarakis, and Viktor Vafeiadis. 2016. Taming Release-Acquire Consistency. In POPL. ACM, New York, NY, USA. 649–662. isbn:9781450335492 https://doi.org/10.1145/2837614.2837643 Google Scholar
Digital Library
- Ori Lahav and Roy Margalit. 2019. Robustness Against Release/Acquire Semantics. In PLDI. ACM, New York, NY, USA. 126–141. isbn:978-1-4503-6712-7 https://doi.org/10.1145/3314221.3314604 Google Scholar
Digital Library
- Ori Lahav, Egor Namakonov, Jonas Oberhauser, Anton Podkopaev, and Viktor Vafeiadis. 2021. Making Weak Memory Models Fair. Full paper version with appendices. arxiv:2012.01067.Google Scholar
- Ori Lahav, Egor Namakonov, Jonas Oberhauser, Anton Podkopaev, and Viktor Vafeiadis. 2021. Making Weak Memory Models Fair: OOPSLA 2021 artifact. https://doi.org/10.5281/zenodo.5496483 Google Scholar
Digital Library
- Ori Lahav, Viktor Vafeiadis, Jeehoon Kang, Chung-Kil Hur, and Derek Dreyer. 2017. Repairing Sequential Consistency in C/C++11. In PLDI. ACM, New York, NY, USA. 618–632. isbn:9781450349888 https://doi.org/10.1145/3062341.3062352 Google Scholar
Digital Library
- Leslie Lamport. 1977. Proving the Correctness of Multiprocess Programs. IEEE Trans. Software Eng., 3, 2 (1977), 125–143. https://doi.org/10.1109/TSE.1977.229904 Google Scholar
Digital Library
- Leslie Lamport. 1979. How to Make a Multiprocessor Computer That Correctly Executes Multiprocess Programs. IEEE Trans. Computers, 28, 9 (1979), 690–691. https://doi.org/10.1109/TC.1979.1675439 Google Scholar
Digital Library
- D. Lehmann, A. Pnueli, and J. Stavi. 1981. Impartiality, Justice and Fairness: The Ethics of Concurrent Termination. In ICALP. Springer Berlin Heidelberg, Berlin, Heidelberg. 264–277. isbn:978-3-540-38745-9 https://doi.org/10.1007/3-540-10843-2_22 Google Scholar
Cross Ref
- Jeremy Manson, William Pugh, and Sarita V. Adve. 2005. The Java Memory Model. In POPL 2005. ACM, New York. 378–391. https://doi.org/10.1145/1040305.1040336 Google Scholar
Digital Library
- Roy Margalit and Ori Lahav. 2021. Verifying Observational Robustness against a C11-Style Memory Model. Proc. ACM Program. Lang., 5, POPL (2021), Article 4, Jan., 33 pages. https://doi.org/10.1145/3434285 Google Scholar
Digital Library
- John M. Mellor-Crummey and Michael L. Scott. 1991. Algorithms for Scalable Synchronization on Shared-Memory Multiprocessors. ACM Trans. Comput. Syst., 9, 1 (1991), Feb., 21–65. issn:0734-2071 https://doi.org/10.1145/103727.103729 Google Scholar
Digital Library
- Jonas Oberhauser. 2018. Store Buffer Reduction in the Presence of Mixed-Size Accesses and Misalignment. In VSTTE 2018 (LNCS, Vol. 11294). Springer, 322–344. https://doi.org/10.1007/978-3-030-03592-1_19 Google Scholar
Cross Ref
- Jonas Oberhauser, Rafael Lourenco de Lima Chehab, Diogo Behrens, Ming Fu, Antonio Paolillo, Lilith Oberhauser, Koustubha Bhat, Yuzhong Wen, Haibo Chen, Jaeho Kim, and Viktor Vafeiadis. 2021. VSync: Push-Button Verification and Optimization for Synchronization Primitives on Weak Memory Models. In ASPLOS. ACM, New York, NY, USA. 530–545. isbn:9781450383172 https://doi.org/10.1145/3445814.3446748 Google Scholar
Digital Library
- Jonas Oberhauser, Lilith Oberhauser, Antonio Paolillo, Diogo Behrens, Ming Fu, and Viktor Vafeiadis. 2021. Verifying and Optimizing the HMCS Lock for Arm Servers. In NETYS 2021. 16 pages. https://people.mpi-sws.org/~viktor/papers/netys2021-hmcs.pdfGoogle Scholar
- Scott Owens, Susmit Sarkar, and Peter Sewell. 2009. A Better x86 Memory Model: x86-TSO. In TPHOLs 2009 (LNCS, Vol. 5674). Springer, 391–407. https://doi.org/10.1007/978-3-642-03359-9_27 Google Scholar
Digital Library
- David Michael Ritchie Park. 1979. On the Semantics of Fair Parallelism. In Abstract Software Specifications 1979, Dines Bjørner (Ed.) (LNCS, Vol. 86). Springer, 504–526. https://doi.org/10.1007/3-540-10007-5_47 Google Scholar
Cross Ref
- Anton Podkopaev, Ori Lahav, and Viktor Vafeiadis. 2019. Bridging the Gap between Programming Languages and Hardware Weak Memory Models. Proc. ACM Program. Lang., 3, POPL (2019), Article 69, Jan., 31 pages. https://doi.org/10.1145/3290382 Google Scholar
Digital Library
- Christopher Pulte, Shaked Flur, Will Deacon, Jon French, Susmit Sarkar, and Peter Sewell. 2017. Simplifying ARM Concurrency: Multicopy-Atomic Axiomatic and Operational Models for ARMv8. Proc. ACM Program. Lang., 2, POPL (2017), Article 19, Dec., 29 pages. https://doi.org/10.1145/3158107 Google Scholar
Digital Library
- Peter Sewell, Susmit Sarkar, Scott Owens, Francesco Zappa Nardelli, and Magnus O. Myreen. 2010. x86-TSO: A Rigorous and Usable Programmer’s Model for x86 Multiprocessors. Commun. ACM, 53, 7 (2010), 89–97. https://doi.org/10.1145/1785414.1785443 Google Scholar
Digital Library
- Viktor Vafeiadis, Thibaut Balabonski, Soham Chakraborty, Robin Morisset, and Francesco Zappa Nardelli. 2015. Common Compiler Optimisations Are Invalid in the C11 Memory Model and What We Can Do about It. In POPL. ACM, New York, NY, USA. 209–220. isbn:9781450333009 https://doi.org/10.1145/2676726.2676995 Google Scholar
Digital Library
- Conrad Watt, Christopher Pulte, Anton Podkopaev, Guillaume Barbier, Stephen Dolan, Shaked Flur, Jean Pichon-Pharabod, and Shu-yu Guo. 2020. Repairing and Mechanising the JavaScript Relaxed Memory Model. In PLDI. ACM, New York, NY, USA. 346–361. isbn:9781450376136 https://doi.org/10.1145/3385412.3385973 Google Scholar
Digital Library
- Conrad Watt, Andreas Rossberg, and Jean Pichon-Pharabod. 2019. Weakening WebAssembly. Proc. ACM Program. Lang., 3, OOPSLA (2019), Article 133, Oct., 28 pages. https://doi.org/10.1145/3360559 Google Scholar
Digital Library
Index Terms
Making weak memory models fair
Recommendations
Verifying read-copy-update in a logic for weak memory
PLDI '15: Proceedings of the 36th ACM SIGPLAN Conference on Programming Language Design and ImplementationRead-Copy-Update (RCU) is a technique for letting multiple readers safely access a data structure while a writer concurrently modifies it. It is used heavily in the Linux kernel in situations where fast reads are important and writes are infrequent. ...
Verifying read-copy-update in a logic for weak memory
PLDI '15Read-Copy-Update (RCU) is a technique for letting multiple readers safely access a data structure while a writer concurrently modifies it. It is used heavily in the Linux kernel in situations where fast reads are important and writes are infrequent. ...
Partial-coherence abstractions for relaxed memory models
PLDI '11: Proceedings of the 32nd ACM SIGPLAN Conference on Programming Language Design and ImplementationWe present an approach for automatic verification and fence inference in concurrent programs running under relaxed memory models. Verification under relaxed memory models is a hard problem. Given a finite state program and a safety specification, ...






Comments