Abstract
Concurrent data structures and synchronization mechanisms implemented by expert developers are indispensable for modular software development. In this paper, we address the fundamental problem of library abstraction under weak memory concurrency, and identify a general library correctness condition allowing clients of the library to reason about program behaviors using the specification code, which is often much simpler than the concrete implementation. We target (a fragment of) the RC11 memory model, and develop an equivalent operational presentation that exposes knowledge propagation between threads, and is sufficiently expressive to capture library behaviors as totally ordered operational execution traces. We further introduce novel access modes to the language that allow intricate specifications accounting for library internal synchronization that is not exposed to the client, as well as the library's demands on external synchronization by the client. We illustrate applications of our approach in several examples of different natures.
- Jade Alglave, Luc Maranget, Paul E. McKenney, Andrea Parri, and Alan Stern. 2018. Frightening Small Children and Disconcerting Grown-ups: Concurrency in the Linux Kernel. In ASPLOS. ACM, New York, NY, USA. 405–418. isbn:978-1-4503-4911-6 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, Mike Dodds, and Alexey Gotsman. 2013. Library Abstraction for C/C++ Concurrency. In POPL. ACM, New York, NY, USA. 235–248. isbn:9781450318327 https://doi.org/10.1145/2429069.2429099
Google Scholar
Digital Library
- Mark Batty, Kayvan Memarian, Kyndylan Nienhuis, Jean Pichon-Pharabod, and Peter Sewell. 2015. The Problem of Programming Language Concurrency Semantics. In ESOP. Springer, Berlin, Heidelberg. 283–307. http://dx.doi.org/10.1007/978-3-662-46669-8_12
Google Scholar
Cross Ref
- Sidi Mohamed Beillahi, Ahmed Bouajjani, and Constantin Enea. 2021. Robustness Against Transactional Causal Consistency. Logical Methods in Computer Science, Volume 17, Issue 1 (2021), Feb., https://doi.org/10.23638/LMCS-17(1:12)2021
Google Scholar
Cross Ref
- Lars Birkedal, Thomas Dinsdale-Young, Armaël Guéneau, Guilhem Jaber, Kasper Svendsen, and Nikos Tzevelekos. 2021. Theorems for Free from Separation Logic Specifications. Proc. ACM Program. Lang., 5, ICFP (2021), Article 81, Aug., 29 pages. https://doi.org/10.1145/3473586
Google Scholar
Digital Library
- Hans-Juergen Boehm and Brian Demsky. 2014. Outlawing Ghosts: Avoiding Out-of-thin-air Results. In MSPC. ACM, New York, NY, USA. Article 7, 6 pages. isbn:978-1-4503-2917-0 https://doi.org/10.1145/2618128.2618134
Google Scholar
Digital Library
- Ahmed Bouajjani, Michael Emmi, Constantin Enea, and Jad Hamza. 2015. Tractable Refinement Checking for Concurrent Objects. In POPL. ACM, New York, NY, USA. 651–662. isbn:9781450333009 https://doi.org/10.1145/2676726.2677002
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
Cross Ref
- Sebastian Burckhardt, Alexey Gotsman, Madanlal Musuvathi, and Hongseok Yang. 2012. Concurrent Library Correctness on the TSO Memory Model. In ESOP. Springer, Berlin, Heidelberg. 87–107. isbn:978-3-642-28869-2 https://doi.org/10.1007/978-3-642-28869-2_5
Google Scholar
Digital Library
- Minki Cho, Sung-Hwan Lee, Chung-Kil Hur, and Ori Lahav. 2021. Modular Data-Race-Freedom Guarantees in the Promising Semantics. In PLDI. ACM, New York, NY, USA. 867–882. isbn:9781450383912 https://doi.org/10.1145/3453483.3454082
Google Scholar
Digital Library
- Sadegh Dalvandi and Brijesh Dongol. 2021. Verifying C11-Style Weak Memory Libraries. In PPoPP. ACM, New York, NY, USA. 451–453. isbn:9781450382946 https://doi.org/10.1145/3437801.3441619
Google Scholar
Digital Library
- Sadegh Dalvandi and Brijesh Dongol. 2021. Verifying C11-Style Weak Memory Libraries via Refinement. CoRR, abs/2108.06944 (2021), arXiv:2108.06944. arxiv:2108.06944
Google Scholar
- Hoang-Hai Dang, Jaehwang Jung, Jaemin Choi, Duc-Than Nguyen, William Mansky, Jeehoon Kang, and Derek Dreyer. 2022. Compass: Strong and Compositional Library Specifications in Relaxed Memory Separation Logic. In PLDI. ACM, New York, NY, USA. 792–808. isbn:9781450392655 https://doi.org/10.1145/3519939.3523451
Google Scholar
Digital Library
- Mathieu Desnoyers, Paul E. McKenney, Alan S. Stern, Michel R. Dagenais, and Jonathan Walpole. 2012. User-Level Implementations of Read-Copy Update. IEEE Trans. Parallel Distrib. Syst., 23, 2 (2012), 375–382. https://doi.org/10.1109/TPDS.2011.159
Google Scholar
Digital Library
- Simon Doherty, Brijesh Dongol, Heike Wehrheim, and John Derrick. 2018. Making Linearizability Compositional for Partially Ordered Executions. In iFM. Springer International Publishing, Cham. 110–129. isbn:978-3-319-98938-9 https://doi.org/10.1007/978-3-319-98938-9_7
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
- Brijesh Dongol, Radha Jagadeesan, James Riely, and Alasdair Armstrong. 2018. On Abstraction and Compositionality for Weak-Memory Linearisability. In VMCAI. Springer International Publishing, Cham. 183–204. isbn:978-3-319-73721-8 https://doi.org/10.1007/978-3-319-73721-8_9
Google Scholar
Cross Ref
- Michael Emmi and Constantin Enea. 2019. Weak-Consistency Specification via Visibility Relaxation. Proc. ACM Program. Lang., 3, POPL (2019), Article 60, Jan., 28 pages. https://doi.org/10.1145/3290373
Google Scholar
Digital Library
- Constantin Enea and Azadeh Farzan. 2016. On Atomicity in Presence of Non-atomic Writes. In TACAS. Springer, Berlin, Heidelberg. 497–514. isbn:978-3-662-49674-9 https://doi.org/10.1007/978-3-662-49674-9_29
Google Scholar
Digital Library
- Ivana Filipović, Peter O’Hearn, Noam Rinetzky, and Hongseok Yang. 2010. Abstraction for concurrent objects. Theoretical Computer Science, 411, 51 (2010), 4379–4398. issn:0304-3975 https://www.sciencedirect.com/science/article/pii/S0304397510005001
Google Scholar
Digital Library
- Thomas Gibson-Robinson, Philip Armstrong, Alexandre Boulgakov, and Andrew W. Roscoe. 2014. FDR3 — A Modern Refinement Checker for CSP. In TACAS. Springer, Berlin, Heidelberg. 187–201. isbn:978-3-642-54862-8 https://doi.org/10.1007/978-3-642-54862-8_13
Google Scholar
Cross Ref
- Alexey Gotsman, Noam Rinetzky, and Hongseok Yang. 2013. Verifying Concurrent Memory Reclamation Algorithms with Grace. In ESOP. Springer, Berlin, Heidelberg. 249–269. isbn:978-3-642-37036-6 https://doi.org/10.1007/978-3-642-37036-6_15
Google Scholar
Digital Library
- Alexey Gotsman and Hongseok Yang. 2011. Liveness-Preserving Atomicity Abstraction. In ICALP. Springer, Berlin, Heidelberg. 453–465. isbn:978-3-642-22012-8 https://doi.org/10.1007/978-3-642-22012-8_36
Google Scholar
Cross Ref
- Alexey Gotsman and Hongseok Yang. 2013. Linearizability with Ownership Transfer. Logical Methods in Computer Science, Volume 9, Issue 3 (2013), Sept., https://lmcs.episciences.org/931
Google Scholar
Cross Ref
- Maurice P. Herlihy and Jeannette M. Wing. 1990. Linearizability: A Correctness Condition for Concurrent Objects. ACM Trans. Program. Lang. Syst., 12, 3 (1990), July, 463–492. issn:0164-0925 https://doi.org/10.1145/78969.78972
Google Scholar
Digital Library
- Ralf Jung. 2019. Logical atomicity in Iris: The good, the bad, and the ugly. In Iris Workshop. https://people.mpi-sws.org/~jung/iris/talk-iris2019.pdf
Google Scholar
- Ralf Jung, David Swasey, Filip Sieczkowski, Kasper Svendsen, Aaron Turon, Lars Birkedal, and Derek Dreyer. 2015. Iris: Monoids and Invariants as an Orthogonal Basis for Concurrent Reasoning. In POPL. ACM, New York, NY, USA. 637–650. isbn:9781450333009 https://doi.org/10.1145/2676726.2676980
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
Cross Ref
- 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
- Artem Khyzha and Ori Lahav. 2021. Taming x86-TSO Persistency. Proc. ACM Program. Lang., 5, POPL (2021), Article 47, Jan., 29 pages. https://doi.org/10.1145/3434328
Google Scholar
Digital Library
- Artem Khyzha and Ori Lahav. 2022. Abstraction for Crash-Resilient Objects. In ESOP. Springer International Publishing, Cham. 262–289. isbn:978-3-030-99336-8 https://doi.org/10.1007/978-3-030-99336-8_10
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. ACM, New York, NY, USA. 96–110. isbn:9781450367127 https://doi.org/10.1145/3314221.3314609
Google Scholar
Digital Library
- Siddharth Krishna, Michael Emmi, Constantin Enea, and Dejan Jovanović. 2020. Verifying Visibility-Based Weak Consistency. In ESOP. Springer International Publishing, Cham. 280–307. isbn:978-3-030-44914-8 https://doi.org/10.1007/978-3-030-44914-8_11
Google Scholar
Digital Library
- Ori Lahav, Nick Giannarakis, and Viktor Vafeiadis. 2016. Taming Release-Acquire Consistency. In POPL. ACM, New York, NY, USA. 649–662. isbn:978-1-4503-3549-2 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, 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:978-1-4503-4988-8 https://doi.org/10.1145/3062341.3062352
Google Scholar
Digital Library
- Leslie Lamport. 1979. How to Make a Multiprocessor Computer That Correctly Executes Multiprocess Programs. IEEE Trans. Computers, 28, 9 (1979), Sept., 690–691. https://doi.org/10.1109/TC.1979.1675439
Google Scholar
Digital Library
- Gavin Lowe. 2017. Analysing Lock-Free Linearizable Datatypes Using CSP. In Concurrency, Security, and Puzzles - Essays Dedicated to Andrew William Roscoe on the Occasion of His 60th Birthday. Springer, 162–184. https://doi.org/10.1007/978-3-319-51046-0_9
Google Scholar
Cross Ref
- Weiyu Luo and Brian Demsky. 2021. C11Tester: A Race Detector for C/C++ Atomics. In ASPLOS. ACM, New York, NY, USA. 630–646. isbn:9781450383172 https://doi.org/10.1145/3445814.3446711
Google Scholar
Digital Library
- Paul E. Mckenney. 2004. Exploiting Deferred Destruction: An Analysis of Read-Copy-Update Techniques in Operating System Kernels. Ph. D. Dissertation. Oregon Health & Science University.
Google Scholar
- Glen Mével and Jacques-Henri Jourdan. 2021. Formal Verification of a Concurrent Bounded Queue in a Weak Memory Model. Proc. ACM Program. Lang., 5, ICFP (2021), Article 66, Aug., 29 pages. https://doi.org/10.1145/3473571
Google Scholar
Digital Library
- Peizhao Ou and Brian Demsky. 2018. Towards Understanding the Costs of Avoiding Out-of-Thin-Air Results. Proc. ACM Program. Lang., 2, OOPSLA (2018), Article 136, Oct., 29 pages. https://doi.org/10.1145/3276506
Google Scholar
Digital Library
- Scott Owens, Susmit Sarkar, and Peter Sewell. 2009. A Better x86 Memory Model: x86-TSO. In TPHOLs. Springer, Berlin, Heidelberg. 391–407. isbn:978-3-642-03358-2 https://doi.org/10.1007/978-3-642-03359-9_27
Google Scholar
Digital Library
- Azalea Raad, Marko Doko, Lovro Rožić, Ori Lahav, and Viktor Vafeiadis. 2019. On Library Correctness under Weak Memory Consistency: Specifying and Verifying Concurrent Libraries under Declarative Consistency Models. Proc. ACM Program. Lang., 3, POPL (2019), Article 68, Jan., 31 pages. https://doi.org/10.1145/3290381
Google Scholar
Digital Library
- Susmit Sarkar, Peter Sewell, Jade Alglave, Luc Maranget, and Derek Williams. 2011. Understanding POWER Multiprocessors. In PLDI. ACM, New York, NY, USA. 175–186. isbn:9781450306638 https://doi.org/10.1145/1993498.1993520
Google Scholar
Digital Library
- Abhishek Kr Singh and Ori Lahav. 2022. An Operational Approach to Library Abstraction under Relaxed Memory Concurrency (Extended Version). https://www.cs.tau.ac.il/~orilahav/papers/popl23_lib_full.pdf
Google Scholar
- Graeme Smith, Kirsten Winter, and Robert J. Colvin. 2020. Linearizability on Hardware Weak Memory Models. Form. Asp. Comput., 32, 1 (2020), Feb., 1–32. issn:0934-5043 https://doi.org/10.1007/s00165-019-00499-8
Google Scholar
Digital Library
Index Terms
An Operational Approach to Library Abstraction under Relaxed Memory Concurrency
Recommendations
Abstraction for Crash-Resilient Objects
Programming Languages and SystemsAbstractWe study abstraction for crash-resilient concurrent objects using non-volatile memory (NVM). We develop a library-correctness criterion that is sound for ensuring contextual refinement in this setting, thus allowing clients to reason about library ...
Linearizability on hardware weak memory models
AbstractLinearizability is a widely accepted notion of correctness for concurrent objects. Recent research has investigated redefining linearizability for particular hardware weak memory models, in particular for TSO. In this paper, we provide an overview ...
Compass: strong and compositional library specifications in relaxed memory separation logic
PLDI 2022: Proceedings of the 43rd ACM SIGPLAN International Conference on Programming Language Design and ImplementationSeveral functional correctness criteria have been proposed for relaxed-memory consistency libraries, but most lack support for modular client reasoning. Mével and Jourdan recently showed that logical atomicity can be used to give strong modular Hoare-...






Comments