Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.1145/3192366.3192373acmconferencesArticle/Chapter ViewAbstractPublication PagespldiConference Proceedingsconference-collections
research-article
Open access

The semantics of transactions and weak memory in x86, Power, ARM, and C++

Published: 11 June 2018 Publication History

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.

Supplementary Material

WEBM File (p211-chong.webm)

References

[1]
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).
[2]
Sarita V. Adve and Mark D. Hill. 1990. Weak Ordering - A New Definition. In Int. Symp. on Computer Architecture (ISCA).
[3]
Jade Alglave, Luc Maranget, Susmit Sarkar, and Peter Sewell. 2010. Fences in Weak Memory Models. In Computer Aided Verification (CAV).
[4]
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).
[5]
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).
[6]
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 .
[7]
ARM. 2017. ARMv8 Architecture Reference Manual. https://static.docs. arm.com/ddi0487/b/DDI0487B_a_armv8_arm.pdf
[8]
Mark Batty, Mike Dodds, and Alexey Gotsman. 2013. Library Abstraction for C/C++ Concurrency. In ACM Symp. on Principles of Programming Languages (POPL).
[9]
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).
[10]
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).
[11]
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.pdf
[12]
Colin Blundell, E. C. Lewis, and Milo M. K. Martin. 2006. Subtleties of Transactional Memory Atomicity Semantics. IEEE Computer Architecture Letters 5, 2 (2006).
[13]
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).
[14]
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).
[15]
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).
[16]
Andrea Cerone, Giovanni Bernardi, and Alexey Gotsman. 2015. A Framework for Transactional Consistency Models with Atomic Visibility. In Int. Conf. on Concurrency Theory (CONCUR).
[17]
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).
[18]
William W. Collier. 1992. Reasoning about Parallel Architectures. Prentice Hall.
[19]
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.pdf
[20]
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).
[21]
Will Deacon. 2016. The ARMv8 Application Level Memory Model. https://github.com/herd/herdtools7/blob/master/herd/libdir/ aarch64.cat . (2016).
[22]
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).
[23]
Brijesh Dongol, Radha Jagadeesan, and James Riely. 2018. Transactions in Relaxed Memory Architectures. In ACM Symp. on Principles of Programming Languages (POPL).
[24]
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).
[25]
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).
[26]
Mark Hachman. 2014. Intel finds specialized TSX enterprise bug on Haswell, Broadwell CP Us. PCWorld (August 2014). http://www. pcworld.com/article/2464880
[27]
Tim Harris, James Larus, and Ravi Rajwar. 2010. Transactional Memory (2nd ed.). Morgan & Claypool.
[28]
Maurice Herlihy and J. Eliot B. Moss. 1993. Transactional Memory: Architectural Support for Lock-Free Data Structures. In Int. Symp. on Computer Architecture (ISCA).
[29]
IBM. 2015. Power ISA (Version 3.0).
[30]
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.pdf
[31]
Intel. 2017. Intel 64 and IA-32 Architectures: Software Developer’s Manual. https://software.intel.com/en-us/articles/intel-sdm
[32]
Intel Developer Zone. 2012. Transactional Synchronization in Haswell. (February 2012). https://software.intel.com/en-us/blogs/2012/02/07/ transactional-synchronization-in-haswell
[33]
ISO/IEC. 2011. Programming languages – C++. International standard 14882:2011.
[34]
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.pdf
[35]
Daniel Jackson. 2012. Software Abstractions – Logic, Language, and Analysis (revised ed.). MIT Press.
[36]
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.pdf
[37]
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).
[38]
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).
[39]
Leslie Lamport. 1979. How to Make a Multiprocessor Computer That Correctly Executes Multiprocess Programs. IEEE Trans. Comput. C-28, 9 (1979).
[40]
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).
[41]
Jan-Willem Maessen and Arvind. 2007. Store Atomicity for Transactional Memory. Electronic Notes in Theoretical Computer Science 174, 9 (2007).
[42]
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).
[43]
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).
[44]
Scott Owens, Susmit Sarkar, and Peter Sewell. 2009. A Better x86 Memory Model: x86-TSO. In Theorem Proving in Higher Order Logics (TPHOLs).
[45]
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).
[46]
Ravi Rajwar and James R. Goodman. 2001. Speculative Lock Elision: Enabling Highly Concurrent Multithreaded Execution. In Int. Symp. on Microarchitecture (MICRO).
[47]
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).
[48]
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).
[49]
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).
[50]
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).
[51]
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).
[52]
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).
[53]
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).
[54]
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/
[55]
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).
[56]
Michael Wong. 2014. Transactional Language Constructs for C++. In C++ Conference (CppCon). http://bit.ly/2tWk4uz

Cited By

View all
  • (2024)Intel PMDK Transactions: Specification, Validation and ConcurrencyProgramming Languages and Systems10.1007/978-3-031-57267-8_6(150-179)Online publication date: 6-Apr-2024
  • (2022)Implementing and verifying release-acquire transactional memory in C11Proceedings of the ACM on Programming Languages10.1145/35633526:OOPSLA2(1817-1844)Online publication date: 31-Oct-2022
  • (2022)High‐coverage metamorphic testing of concurrency support in C compilersSoftware Testing, Verification and Reliability10.1002/stvr.181232:4Online publication date: 22-Mar-2022
  • Show More Cited By

Index Terms

  1. The semantics of transactions and weak memory in x86, Power, ARM, and C++

      Recommendations

      Comments

      Information & Contributors

      Information

      Published In

      cover image ACM Conferences
      PLDI 2018: Proceedings of the 39th ACM SIGPLAN Conference on Programming Language Design and Implementation
      June 2018
      825 pages
      ISBN:9781450356985
      DOI:10.1145/3192366
      This work is licensed under a Creative Commons Attribution-ShareAlike International 4.0 License.

      Sponsors

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      Published: 11 June 2018

      Check for updates

      Badges

      Author Tags

      1. Program Synthesis
      2. Shared Memory Concurrency
      3. Transactional Memory
      4. Weak Memory

      Qualifiers

      • Research-article

      Funding Sources

      • EPSRC

      Conference

      PLDI '18
      Sponsor:

      Acceptance Rates

      Overall Acceptance Rate 406 of 2,067 submissions, 20%

      Contributors

      Other Metrics

      Bibliometrics & Citations

      Bibliometrics

      Article Metrics

      • Downloads (Last 12 months)244
      • Downloads (Last 6 weeks)32
      Reflects downloads up to 12 Jan 2025

      Other Metrics

      Citations

      Cited By

      View all
      • (2024)Intel PMDK Transactions: Specification, Validation and ConcurrencyProgramming Languages and Systems10.1007/978-3-031-57267-8_6(150-179)Online publication date: 6-Apr-2024
      • (2022)Implementing and verifying release-acquire transactional memory in C11Proceedings of the ACM on Programming Languages10.1145/35633526:OOPSLA2(1817-1844)Online publication date: 31-Oct-2022
      • (2022)High‐coverage metamorphic testing of concurrency support in C compilersSoftware Testing, Verification and Reliability10.1002/stvr.181232:4Online publication date: 22-Mar-2022
      • (2021)Specifying and testing GPU workgroup progress modelsProceedings of the ACM on Programming Languages10.1145/34855085:OOPSLA(1-30)Online publication date: 15-Oct-2021
      • (2021)Armed CatsACM Transactions on Programming Languages and Systems10.1145/345892643:2(1-54)Online publication date: 23-Jul-2021
      • (2020)Foundations of empirical memory consistency testingProceedings of the ACM on Programming Languages10.1145/34282944:OOPSLA(1-29)Online publication date: 13-Nov-2020
      • (2020)A study of the learnability of relational properties: model counting meets machine learning (MCML)Proceedings of the 41st ACM SIGPLAN Conference on Programming Language Design and Implementation10.1145/3385412.3386015(1098-1111)Online publication date: 11-Jun-2020
      • (2020)Designing Neural Networks Using Logical Specs2020 IEEE 31st International Symposium on Software Reliability Engineering (ISSRE)10.1109/ISSRE5003.2020.00024(160-171)Online publication date: Oct-2020
      • (2019)Persistency semantics of the Intel-x86 architectureProceedings of the ACM on Programming Languages10.1145/33710794:POPL(1-31)Online publication date: 20-Dec-2019
      • (2019)Weak persistency semantics from the ground up: formalising the persistency semantics of ARMv8 and transactional modelsProceedings of the ACM on Programming Languages10.1145/33605613:OOPSLA(1-27)Online publication date: 10-Oct-2019
      • Show More Cited By

      View Options

      View options

      PDF

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader

      Login options

      Media

      Figures

      Other

      Tables

      Share

      Share

      Share this Publication link

      Share on social media