Abstract
Weak memory models provide a complex, system-centric semantics for concurrent programs, while transactional memory (TM) provides a simpler, programmer-centric semantics. Both have been studied in detail, but their combined semantics is not well understood. This is problematic because such widely-used architectures and languages as x86, Power, and C++ all support TM, and all have weak memory models.
Our work aims to clarify the interplay between weak memory and TM by extending existing axiomatic weak memory models (x86, Power, ARMv8, and C++) with new rules for TM. Our formal models are backed by automated tooling that enables (1) the synthesis of tests for validating our models against existing implementations and (2) the model-checking of TM-related transformations, such as lock elision and compiling C++ transactions to hardware. A key finding is that a proposed TM extension to ARMv8 currently being considered within ARM Research is incompatible with lock elision without sacrificing portability or performance.
Supplemental Material
- Allon Adir, Dave Goodman, Daniel Hershcovich, Oz Hershkovitz, Bryan Hickerson, Karen Holtz, Wisam Kadry, Anatoly Koyfman, John Ludden, Charles Meissner, Amir Nahir, Randall R. Pratt, Mike Schliffli, Brett St Onge, Brian Thompto, Elena Tsanko, and Avi Ziv. 2014. Verification of Transactional Memory in POWER8. In Design Automation Conference (DAC). Google Scholar
Digital Library
- Sarita V. Adve and Mark D. Hill. 1990. Weak Ordering - A New Definition. In Int. Symp. on Computer Architecture (ISCA). Google Scholar
Digital Library
- Jade Alglave, Luc Maranget, Susmit Sarkar, and Peter Sewell. 2010. Fences in Weak Memory Models. In Computer Aided Verification (CAV). Google Scholar
Digital Library
- Jade Alglave, Luc Maranget, Susmit Sarkar, and Peter Sewell. 2011. Litmus: Running Tests Against Hardware. In Int. Conf. on Tools and Algorithms for Construction and Analysis of Systems (TACAS). 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. on Programming Languages and Systems (TOPLAS) 36, 2 (2014). Google Scholar
Digital Library
- Jade Alglave, Luc Maranget, and Michael Tautschnig. 2014. Herding cats: modelling, simulation, testing, and data-mining for weak memory (online companion material). (2014). http://moscova.inria.fr/ ~maranget/cats/model-power/all.html#sec4 .Google Scholar
- ARM. 2017. ARMv8 Architecture Reference Manual. https://static.docs. arm.com/ddi0487/b/DDI0487B_a_armv8_arm.pdfGoogle Scholar
- Mark Batty, Mike Dodds, and Alexey Gotsman. 2013. Library Abstraction for C/C++ Concurrency. In ACM Symp. on Principles of Programming Languages (POPL). Google Scholar
Digital Library
- Mark Batty, Alastair F. Donaldson, and John Wickerson. 2016. Overhauling SC atomics in C11 and OpenCL. In ACM Symp. on Principles of Programming Languages (POPL). Google Scholar
Digital Library
- Mark Batty, Kayvan Memarian, Kyndylan Nienhuis, Jean PichonPharabod, and Peter Sewell. 2015. The Problem of Programming Language Concurrency Semantics. In Europ. Symp. on Programming (ESOP).Google Scholar
- Armin Biere. 2010. Lingeling, Plingeling, PicoSAT and PrecoSAT at SAT Race 2010. Technical Report 10/1. Institute for Formal Models and Verification, Johannes Kepler University. http://fmv.jku.at/papers/ Biere-FMV-TR-10-1.pdfGoogle Scholar
- Colin Blundell, E. C. Lewis, and Milo M. K. Martin. 2006. Subtleties of Transactional Memory Atomicity Semantics. IEEE Computer Architecture Letters 5, 2 (2006). Google Scholar
Digital Library
- Hans-J. Boehm and Sarita V. Adve. 2008. Foundations of the C++ Concurrency Memory Model. In ACM Conf. on Programming Language Design and Implementation (PLDI). Google Scholar
Digital Library
- James Bornholt and Emina Torlak. 2017. Synthesizing Memory Models from Framework Sketches and Litmus Tests. In ACM Conf. on Programming Language Design and Implementation (PLDI). Google Scholar
Digital Library
- Harold W. Cain, Brad Frey, Derek Williams, Maged M. Michael, Cathy May, and Hung Le. 2013. Robust Architectural Support for Transactional Memory in the Power Architecture. In Int. Symp. on Computer Architecture (ISCA). Google Scholar
Digital Library
- Andrea Cerone, Giovanni Bernardi, and Alexey Gotsman. 2015. A Framework for Transactional Consistency Models with Atomic Visibility. In Int. Conf. on Concurrency Theory (CONCUR).Google Scholar
- JaeWoong Chung, Michael Dalton, Hari Kannan, and Christos Kozyrakis. 2008. Thread-Safe Dynamic Binary Translation using Transactional Memory. In Int. Symp. on High Performance Computer Architecture (HPCA).Google Scholar
- William W. Collier. 1992. Reasoning about Parallel Architectures. Prentice Hall. Google Scholar
Digital Library
- Luke Dalessandro and Michael L. Scott. 2009. Strong Isolation is a Weak Idea. In ACM Workshop on Transactional Computing (TRANSACT). http://transact09.cs.washington.edu/33_paper.pdfGoogle Scholar
- Luke Dalessandro, Michael L. Scott, and Michael F. Spear. 2010. Transactions as the Foundation of a Memory Consistency Model. In Int. Conf. on Distributed Computing (DISC). Google Scholar
Digital Library
- Will Deacon. 2016. The ARMv8 Application Level Memory Model. https://github.com/herd/herdtools7/blob/master/herd/libdir/ aarch64.cat . (2016).Google Scholar
- Dave Dice, Yossi Lev, Mark Moir, and Dan Nussbaum. 2009. Early Experience with a Commercial Hardware Transactional Memory Implementation. In Int. Conf. on Architectural Support for Programming Languages and Operating Systems (ASPLOS). Google Scholar
Digital Library
- Brijesh Dongol, Radha Jagadeesan, and James Riely. 2018. Transactions in Relaxed Memory Architectures. In ACM Symp. on Principles of Programming Languages (POPL). 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 ACM Symp. on Principles of Programming Languages (POPL). Google Scholar
Digital Library
- Dan Grossman, Jeremy Manson, and William Pugh. 2006. What Do High-Level Memory Models Mean for Transactions?. In ACM Workshop on Memory Systems Performance & Correctness (MSPC). Google Scholar
Digital Library
- Mark Hachman. 2014. Intel finds specialized TSX enterprise bug on Haswell, Broadwell CP Us. PCWorld (August 2014). http://www. pcworld.com/article/2464880Google Scholar
- Tim Harris, James Larus, and Ravi Rajwar. 2010. Transactional Memory (2nd ed.). Morgan & Claypool. Google Scholar
Digital Library
- Maurice Herlihy and J. Eliot B. Moss. 1993. Transactional Memory: Architectural Support for Lock-Free Data Structures. In Int. Symp. on Computer Architecture (ISCA). Google Scholar
Digital Library
- IBM. 2015. Power ISA (Version 3.0).Google Scholar
- Intel. 2017. 6th Generation Intel Processor Family: Specification Update. (June 2017). https://www3.intel.com/content/ dam/www/public/us/en/documents/specification-updates/ desktop-6th-gen-core-family-spec-update.pdfGoogle Scholar
- Intel. 2017. Intel 64 and IA-32 Architectures: Software Developer’s Manual. https://software.intel.com/en-us/articles/intel-sdmGoogle Scholar
- Intel Developer Zone. 2012. Transactional Synchronization in Haswell. (February 2012). https://software.intel.com/en-us/blogs/2012/02/07/ transactional-synchronization-in-haswellGoogle Scholar
- ISO/IEC. 2011. Programming languages – C++. International standard 14882:2011.Google Scholar
- ISO/IEC. 2015. Technical Specification for C++ Extensions for Transactional Memory. Draft technical specification. http://www.open-std. org/jtc1/sc22/wg21/docs/papers/2015/n4514.pdfGoogle Scholar
- Daniel Jackson. 2012. Software Abstractions – Logic, Language, and Analysis (revised ed.). MIT Press. Google Scholar
Digital Library
- Eric H. Jensen, Gary W. Hagensen, and Jeffrey M. Broughton. 1987. A New Approach to Exclusive Data Access in Shared Memory Multiprocessors. Technical Report 97663. Lawrence Livermore National Laboratory. https://e-reports-ext.llnl.gov/pdf/212157.pdfGoogle Scholar
- Michalis Kokologiannakis, Ori Lahav, Konstantinos Sagonas, and Viktor Vafeiadis. 2018. Effective Stateless Model Checking for C/C++ Concurrency. In ACM Symp. on Principles of Programming Languages (POPL). 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 ACM Conf. on Programming Language Design and Implementation (PLDI). Google Scholar
Digital Library
- Leslie Lamport. 1979. How to Make a Multiprocessor Computer That Correctly Executes Multiprocess Programs. IEEE Trans. Comput. C-28, 9 (1979). Google Scholar
Digital Library
- Daniel Lustig, Andrew Wright, Alexandros Papakonstantinou, and Olivier Giroux. 2017. Automated Synthesis of Comprehensive Memory Model Litmus Test Suites. In Int. Conf. on Architectural Support for Programming Languages and Operating Systems (ASPLOS). Google Scholar
Digital Library
- Jan-Willem Maessen and Arvind. 2007. Store Atomicity for Transactional Memory. Electronic Notes in Theoretical Computer Science 174, 9 (2007). Google Scholar
Digital Library
- Chaiyasit Manovit, Sudheendra Hangal, Hassan Chafi, Austen McDonald, Christos Kozyrakis, and Kunle Olukotun. 2006. Testing Implementations of Transactional Memory. In Int. Conf. on Parallel Architectures and Compilation Techniques (PACT). Google Scholar
Digital Library
- Kyndylan Nienhuis, Kayvan Memarian, and Peter Sewell. 2016. An Operational Semantics for C/C++11 Concurrency. In ACM Int. Conf. on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA). Google Scholar
Digital Library
- Scott Owens, Susmit Sarkar, and Peter Sewell. 2009. A Better x86 Memory Model: x86-TSO. In Theorem Proving in Higher Order Logics (TPHOLs). Google Scholar
Digital Library
- Christopher Pulte, Shaked Flur, Will Deacon, Jon French, Susmit Sarkar, and Peter Sewell. 2018. Simplifying ARM Concurrency: Multicopyatomic Axiomatic and Operational Models for ARMv8. In ACM Symp. on Principles of Programming Languages (POPL). Google Scholar
Digital Library
- Ravi Rajwar and James R. Goodman. 2001. Speculative Lock Elision: Enabling Highly Concurrent Multithreaded Execution. In Int. Symp. on Microarchitecture (MICRO). Google Scholar
Digital Library
- Susmit Sarkar, Kayvan Memarian, Scott Owens, Mark Batty, Peter Sewell, Luc Maranget, Jade Alglave, and Derek Williams. 2012. Synchronising C/C++ and POWER. In ACM Conf. on Programming Language Design and Implementation (PLDI). Google Scholar
Digital Library
- Susmit Sarkar, Peter Sewell, Jade Alglave, Luc Maranget, and Derek Williams. 2011. Understanding POWER Multiprocessors. In ACM Conf. on Programming Language Design and Implementation (PLDI). Google Scholar
Digital Library
- Dennis Shasha and Marc Snir. 1988. Efficient and Correct Execution of Parallel Programs that Share Memory. ACM Trans. on Programming Languages and Systems (TOPLAS) 10, 2 (1988). Google Scholar
Digital Library
- Tatiana Shpeisman, Ali-Reza Adl-Tabatabai, Robert Geva, Yang Ni, and Adam Welc. 2009. Towards Transactional Memory Semantics for C++. In Symp. on Parallelism in Algorithms and Architectures (SPAA). Google Scholar
Digital Library
- Tatiana Shpeisman, Vijay Menon, Ali-Reza Adl-Tabatabai, Steven Balensiefer, Dan Grossman, Richard L. Hudson, Katherine F. Moore, and Bratin Saha. 2007. Enforcing Isolation and Ordering in STM. In ACM Conf. on Programming Language Design and Implementation (PLDI). Google Scholar
Digital Library
- Tyler Sorensen, Alastair F. Donaldson, Mark Batty, Ganesh Gopalakrishnan, and Zvonimir Rakamarić. 2016. Portable Inter-workgroup Barrier Synchronisation for GP Us. In ACM Int. Conf. on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA). Google Scholar
Digital Library
- Srdan Stipić, Vesna Smiljković, Osman Unsal, Adrián Cristal, and Mateo Valero. 2013. Profile-Guided Transaction Coalescing—Lowering Transactional Overheads by Merging Transactions. ACM Transactions on Architecture and Code Optimization 10, 4 (2013). Google Scholar
Digital Library
- Andrew Waterman and Krste Asanović (Eds.). 2017. The RISC-V Instruction Set Manual, Volume I: User-Level ISA (version 2.2). RISC-V Foundation. https://riscv.org/specifications/Google Scholar
- John Wickerson, Mark Batty, Tyler Sorensen, and George A. Constantinides. 2017. Automatically Comparing Memory Consistency Models. In ACM Symp. on Principles of Programming Languages (POPL). Google Scholar
Digital Library
- Michael Wong. 2014. Transactional Language Constructs for C++. In C++ Conference (CppCon). http://bit.ly/2tWk4uzGoogle Scholar
Index Terms
The semantics of transactions and weak memory in x86, Power, ARM, and C++
Recommendations
The semantics of transactions and weak memory in x86, Power, ARM, and C++
PLDI 2018: Proceedings of the 39th ACM SIGPLAN Conference on Programming Language Design and ImplementationWeak memory models provide a complex, system-centric semantics for concurrent programs, while transactional memory (TM) provides a simpler, programmer-centric semantics. Both have been studied in detail, but their combined semantics is not well ...
Towards transactional memory semantics for C++
SPAA '09: Proceedings of the twenty-first annual symposium on Parallelism in algorithms and architecturesTransactional memory (TM) eliminates many problems associated with lock-based synchronization. Over recent years, much progress has been made in software and hardware implementation techniques for TM. However, before transactional memory can be ...
Safe open-nested transactions through ownership
PPoPP '09: Proceedings of the 14th ACM SIGPLAN symposium on Principles and practice of parallel programmingResearchers in transactional memory (TM) have proposed open nesting as a methodology for increasing the concurrency of transactional programs. The idea is to ignore ``low-level'' memory operations of an open-nested transaction when detecting conflicts ...







Comments