skip to main content
research-article
Open Access
Artifacts Evaluated & Functional

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

Published:11 June 2018Publication History
Skip Abstract Section

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.

Skip Supplemental Material Section

Supplemental Material

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). Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Sarita V. Adve and Mark D. Hill. 1990. Weak Ordering - A New Definition. In Int. Symp. on Computer Architecture (ISCA). Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Jade Alglave, Luc Maranget, Susmit Sarkar, and Peter Sewell. 2010. Fences in Weak Memory Models. In Computer Aided Verification (CAV). Google ScholarGoogle ScholarDigital LibraryDigital Library
  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). Google ScholarGoogle ScholarDigital LibraryDigital Library
  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). Google ScholarGoogle ScholarDigital LibraryDigital Library
  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 .Google ScholarGoogle Scholar
  7. ARM. 2017. ARMv8 Architecture Reference Manual. https://static.docs. arm.com/ddi0487/b/DDI0487B_a_armv8_arm.pdfGoogle ScholarGoogle Scholar
  8. Mark Batty, Mike Dodds, and Alexey Gotsman. 2013. Library Abstraction for C/C++ Concurrency. In ACM Symp. on Principles of Programming Languages (POPL). Google ScholarGoogle ScholarDigital LibraryDigital Library
  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). Google ScholarGoogle ScholarDigital LibraryDigital Library
  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).Google ScholarGoogle Scholar
  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.pdfGoogle ScholarGoogle Scholar
  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). Google ScholarGoogle ScholarDigital LibraryDigital Library
  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). Google ScholarGoogle ScholarDigital LibraryDigital Library
  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). Google ScholarGoogle ScholarDigital LibraryDigital Library
  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). Google ScholarGoogle ScholarDigital LibraryDigital Library
  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).Google ScholarGoogle Scholar
  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).Google ScholarGoogle Scholar
  18. William W. Collier. 1992. Reasoning about Parallel Architectures. Prentice Hall. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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.pdfGoogle ScholarGoogle Scholar
  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). Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Will Deacon. 2016. The ARMv8 Application Level Memory Model. https://github.com/herd/herdtools7/blob/master/herd/libdir/ aarch64.cat . (2016).Google ScholarGoogle Scholar
  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). Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Brijesh Dongol, Radha Jagadeesan, and James Riely. 2018. Transactions in Relaxed Memory Architectures. In ACM Symp. on Principles of Programming Languages (POPL). Google ScholarGoogle ScholarDigital LibraryDigital Library
  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). Google ScholarGoogle ScholarDigital LibraryDigital Library
  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). Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Mark Hachman. 2014. Intel finds specialized TSX enterprise bug on Haswell, Broadwell CP Us. PCWorld (August 2014). http://www. pcworld.com/article/2464880Google ScholarGoogle Scholar
  27. Tim Harris, James Larus, and Ravi Rajwar. 2010. Transactional Memory (2nd ed.). Morgan & Claypool. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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). Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. IBM. 2015. Power ISA (Version 3.0).Google ScholarGoogle Scholar
  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.pdfGoogle ScholarGoogle Scholar
  31. Intel. 2017. Intel 64 and IA-32 Architectures: Software Developer’s Manual. https://software.intel.com/en-us/articles/intel-sdmGoogle ScholarGoogle Scholar
  32. Intel Developer Zone. 2012. Transactional Synchronization in Haswell. (February 2012). https://software.intel.com/en-us/blogs/2012/02/07/ transactional-synchronization-in-haswellGoogle ScholarGoogle Scholar
  33. ISO/IEC. 2011. Programming languages – C++. International standard 14882:2011.Google ScholarGoogle Scholar
  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.pdfGoogle ScholarGoogle Scholar
  35. Daniel Jackson. 2012. Software Abstractions – Logic, Language, and Analysis (revised ed.). MIT Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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.pdfGoogle ScholarGoogle Scholar
  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). Google ScholarGoogle ScholarDigital LibraryDigital Library
  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). Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. Leslie Lamport. 1979. How to Make a Multiprocessor Computer That Correctly Executes Multiprocess Programs. IEEE Trans. Comput. C-28, 9 (1979). Google ScholarGoogle ScholarDigital LibraryDigital Library
  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). Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. Jan-Willem Maessen and Arvind. 2007. Store Atomicity for Transactional Memory. Electronic Notes in Theoretical Computer Science 174, 9 (2007). Google ScholarGoogle ScholarDigital LibraryDigital Library
  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). Google ScholarGoogle ScholarDigital LibraryDigital Library
  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). Google ScholarGoogle ScholarDigital LibraryDigital Library
  44. Scott Owens, Susmit Sarkar, and Peter Sewell. 2009. A Better x86 Memory Model: x86-TSO. In Theorem Proving in Higher Order Logics (TPHOLs). Google ScholarGoogle ScholarDigital LibraryDigital Library
  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). Google ScholarGoogle ScholarDigital LibraryDigital Library
  46. Ravi Rajwar and James R. Goodman. 2001. Speculative Lock Elision: Enabling Highly Concurrent Multithreaded Execution. In Int. Symp. on Microarchitecture (MICRO). Google ScholarGoogle ScholarDigital LibraryDigital Library
  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). Google ScholarGoogle ScholarDigital LibraryDigital Library
  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). Google ScholarGoogle ScholarDigital LibraryDigital Library
  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). Google ScholarGoogle ScholarDigital LibraryDigital Library
  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). Google ScholarGoogle ScholarDigital LibraryDigital Library
  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). Google ScholarGoogle ScholarDigital LibraryDigital Library
  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). Google ScholarGoogle ScholarDigital LibraryDigital Library
  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). Google ScholarGoogle ScholarDigital LibraryDigital Library
  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/Google ScholarGoogle Scholar
  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). Google ScholarGoogle ScholarDigital LibraryDigital Library
  56. Michael Wong. 2014. Transactional Language Constructs for C++. In C++ Conference (CppCon). http://bit.ly/2tWk4uzGoogle ScholarGoogle Scholar

Index Terms

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

      Recommendations

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in

      Full Access

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader
      About Cookies On This Site

      We use cookies to ensure that we give you the best experience on our website.

      Learn more

      Got it!