Abstract
C++ has supported a provisional version of Transactional Memory (TM) since 2015, via a technical specification. However, TM has not seen widespread adoption, and compiler vendors have been slow to implement the technical specification. We conjecture that the proposed TM support is too difficult for programmers to use, too complex for compiler designers to implement and verify, and not industry-proven enough to justify final standardization in its current form.
To address these problems, we present a different design for supporting TM in C++. By forbidding explicit self-abort, and by introducing an executor-based mechanism for running transactions, our approach makes it easier for developers to get code up and running with TM. Our proposal should also be appealing to compiler developers, as it allows a spectrum of levels of support for TM, with varying performance, and varying reliance on hardware TM support in order to provide scalability.
<?tight?>While our design does not enable some of the optimizations admitted by the current technical specification, we show that it enables the implementation of robust support for TM in a small, orthogonal compiler extension. Our implementation is able to handle a wide range of transactional programs, delivering low instrumentation overhead and scalability and performance on par with the current state of the art. Based on this experience, we believe our approach to be a viable means of reinvigorating the standardization of TM in C++.
- Ali-Reza Adl-Tabatabai, Brian T. Lewis, Vijay Menon, Brian R. Murphy, Bratin Saha, and Tatiana Shpeisman. 2006. Compiler and runtime support for efficient software transactional memory. In Proceedings of the 27th ACM Conference on Programming Language Design and Implementation. Google ScholarDigital Library
- Sara Baghsorkhi and Christos Margiolas. 2018. Automating efficient variable-grained resiliency for low-power IoT systems. In Proceedings of the 2018 International Symposium on Code Generation and Optimization. Google ScholarDigital Library
- Colin Blundell, E. Christopher Lewis, and Milo M. K. Martin. 2006. Subtleties of transactional memory atomicity semantics. Computer Architecture Letters 5, 2 (Nov. 2006), 17:1–17:4. Google ScholarDigital Library
- Jayaram Bobba, Kevin E. Moore, Haris Volos, Luke Yen, Mark D. Hill, Michael M. Swift, and David A. Wood. 2007. Performance pathologies in hardware transactional memory. In Proceedings of the 34th International Symposium on Computer Architecture. Google ScholarDigital Library
- Irina Calciu, Justin Gottschlich, Tatiana Shpeisman, Gilles Pokam, and Maurice Herlihy. 2014. Invyswell: A hybrid transactional memory for Haswell’s restricted transactional memory. In Proceedings of the 23rd International Conference on Parallel Architectures and Compilation Techniques. Google ScholarDigital Library
- Brian D. Carlstrom, Austen McDonald, Hassan Chafi, JaeWoong Chung, Chi Cao Minh, Christos Kozyrakis, and Kunle Olukotun. 2006. The atomos transactional programming language. In Proceedings of the 27th ACM Conference on Programming Language Design and Implementation. Google ScholarDigital Library
- Keith Chapman, Antony Hosking, and Eliot Moss. 2016. Hybrid STM/HTM for nested transactions on OpenJDK. In Proceedings of the 31rd ACM Conference on Object Oriented Programming, Systems, Languages, and Applications. Google ScholarDigital Library
- Dave Christie, Jae-Woong Chung, Stephan Diestelhorst, Michael Hohmuth, Martin Pohlack, Christof Fetzer, Martin Nowack, Torvald Riegel, Pascal Felber, Patrick Marlier, and Etienne Riviere. 2010. Evaluation of AMD’s advanced synchronization facility within a complete transactional memory stack. In Proceedings of the EuroSys 2010 Conference. Google ScholarDigital Library
- Luke Dalessandro, Francois Carouge, Sean White, Yossi Lev, Mark Moir, Michael L. Scott, and Michael Spear. 2011. Hybrid NOrec: A case study in the effectiveness of best effort hardware transactional memory. In Proceedings of the 16th International Conference on Architectural Support for Programming Languages and Operating Systems. Google ScholarDigital Library
- Luke Dalessandro, Dave Dice, Michael L. Scott, Nir Shavit, and Michael Spear. 2010. Transactional mutex locks. In Proceedings of the Euro-Par 2010 Conference. Google ScholarDigital Library
- Luke Dalessandro, Michael L. Scott, and Michael Spear. 2010. Transactions as the Foundation of a Memory Consistency Model. In Proceedings of the 24th International Symposium on Distributed Computing. Google ScholarDigital Library
- Luke Dalessandro, Michael Spear, and Michael L. Scott. 2010. NOrec: Streamlining STM by abolishing ownership records. In Proceedings of the 15th ACM Symposium on Principles and Practice of Parallel Programming. Google ScholarDigital Library
- Joel Denny, Seyong Lee, and Jeffrey Vetter. 2016. ANVL-C: Static analysis techniques for efficient, correct programming of non-volatile main memory systems. In Proceedings of the 25th ACM International Symposium on High-Performance Parallel and Distributed Computing. Google ScholarDigital Library
- Dave Dice, Ori Shalev, and Nir Shavit. 2006. Transactional locking II. In Proceedings of the 20th International Symposium on Distributed Computing. Google ScholarDigital Library
- Pascal Felber, Christof Fetzer, and Torvald Riegel. 2008. Dynamic performance tuning of word-based software transactional memory. In Proceedings of the 13th ACM Symposium on Principles and Practice of Parallel Programming. Google ScholarDigital Library
- Free Software Foundation. 2012. Transactional Memory in GCC. Retrieved from http://gcc.gnu.org/wiki/TransactionalMemory.Google Scholar
- Tim Harris, Mark Plesko, Avraham Shinar, and David Tarditi. 2006. Optimizing memory transactions. In Proceedings of the 27th ACM Conference on Programming Language Design and Implementation. Google ScholarDigital Library
- Maurice P. Herlihy and J. Eliot B. Moss. 1993. Transactional memory: Architectural support for lock-free data structures. In Proceedings of the 20th International Symposium on Computer Architecture. Google ScholarDigital Library
- ISO/IEC JTC 1/SC 22/WG 21. 2015. Technical Specification for C++ Extensions for Transactional Memory. Retrieved from http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4514.pdf.Google Scholar
- Matthew Kilgore, Stephen Louie, Chao Wang, Tingzhe Zhou, Wenjia Ruan, Yujie Liu, and Michael Spear. 2015. Transactional tools for the third decade. In Proceedings of the 10th ACM SIGPLAN Workshop on Transactional Computing.Google Scholar
- Guy Korland, Nir Shavit, and Pascal Felber. 2010. Noninvasive concurrency with Java STM. In Proceedings of the 3rd Workshop on Programmability Issues for Multi-Core Computers.Google Scholar
- Chris Lattner and Vikram Adve. 2004. LLVM: A compilation framework for lifelong program analysis 8 transformation. In Proceedings of the International Symposium on Code Generation and Optimization. Google ScholarDigital Library
- Heiner Litz, Ricardo Dias, and David Cheriton. 2015. Efficient correction of anomalies in snapshot isolation transactions. ACM Transactions on Architecture and Code Optimization 11, 4 (Dec. 2015), 65:1--65:24. Google ScholarDigital Library
- Yujie Liu, Justin Gottschlich, Gilles Pokam, and Michael Spear. 2015. TSXProf: Profiling hardware transactions. In Proceedings of the 24th International Conference on Parallel Architectures and Compilation Techniques. San Francisco, CA. Google ScholarDigital Library
- José F. Martínez and Josep Torrellas. 2002. Speculative synchronization: Applying thread-level speculation to explicitly parallel applications. In Proceedings of the 10th International Conference on Architectural Support for Programming Languages and Operating Systems. Google ScholarDigital Library
- Alexander Matveev and Nir Shavit. 2015. Reduced hardware NORec: A safe and scalable hybrid transactional memory. In Proceedings of the 19th International Conference on Architectural Support for Programming Languages and Operating Systems. Google ScholarDigital Library
- Vijay Menon, Steven Balensiefer, Tatiana Shpeisman, Ali-Reza Adl-Tabatabai, Richard Hudson, Bratin Saha, and Adam Welc. 2008. Practical weak-atomicity semantics for Java STM. In Proceedings of the 20th ACM Symposium on Parallelism in Algorithms and Architectures. Google ScholarDigital Library
- Chi Cao Minh, JaeWoong Chung, Christos Kozyrakis, and Kunle Olukotun. 2008. STAMP: Stanford transactional applications for multi-processing. In Proceedings of the IEEE International Symposium on Workload Characterization.Google Scholar
- Takuya Nakaike, Rei Odaira, Matthew Gaudet, Maged M. Michael, and Hisanobu Tomari. 2015. Quantitative comparison of hardware transactional memory for blue Gene/Q, zEnterprise EC12, Intel Core, and POWER8. In Proceedings of the 42nd Annual International Symposium on Computer Architecture. Portland, OR. Google ScholarDigital Library
- Yang Ni, Adam Welc, Ali-Reza Adl-Tabatabai, Moshe Bach, Sion Berkowits, James Cownie, Robert Geva, Sergey Kozhukow, Ravi Narayanaswamy, Jeffrey Olivier, Serguei Preis, Bratin Saha, Ady Tal, and Xinmin Tian. 2008. Design and implementation of transactional constructs for C/C++. In Proceedings of the 23rd ACM Conference on Object Oriented Programming, Systems, Languages, and Applications. Google ScholarDigital Library
- Victor Pankratius and Ali-Reza Adl-Tabatabai. 2011. A study of transactional memory vs. locks in practice. In Proceedings of the 23rd ACM Symposium on Parallelism in Algorithms and Architectures. Google ScholarDigital Library
- Ravi Rajwar and James R. Goodman. 2001. Speculative lock elision: Enabling highly concurrent multithreaded execution. In Proceedings of the 34th IEEE/ACM International Symposium on Microarchitecture. Google ScholarDigital Library
- Ravi Rajwar and James R. Goodman. 2002. Transactional lock-free execution of lock-based programs. In Proceedings of the 10th International Conference on Architectural Support for Programming Languages and Operating Systems. Google ScholarDigital Library
- Wenjia Ruan and Michael Spear. 2015. Hybrid transactional memory revisited. In Proceedings of the 29th International Symposium on Distributed Computing. Google ScholarDigital Library
- Wenjia Ruan, Trilok Vyas, Yujie Liu, and Michael Spear. 2014. Transactionalizing legacy code: An experience report using GCC and memcached. In Proceedings of the 19th International Conference on Architectural Support for Programming Languages and Operating Systems. Google ScholarDigital Library
- Bratin Saha, Ali-Reza Adl-Tabatabai, Richard L. Hudson, Chi Cao Minh, and Benjamin Hertzberg. 2006. McRT-STM: A high performance software transactional memory system for a multi-core runtime. In Proceedings of the 11th ACM Symposium on Principles and Practice of Parallel Programming. New York, NY. Google ScholarDigital Library
- William N. Scherer III and Michael L. Scott. 2005. Advanced contention management for dynamic software transactional memory. In Proceedings of the 24th ACM Symposium on Principles of Distributed Computing. Google ScholarDigital Library
- Nir Shavit and Dan Touitou. 1995. Software transactional memory. In Proceedings of the 14th ACM Symposium on Principles of Distributed Computing. Google ScholarDigital Library
- Tatiana Shpeisman, Ali-Reza Adl-Tabatabai, Robert Geva, Yang Ni, and Adam Welc. 2009. Towards transactional memory semantics for C++. In Proceedings of the 21st ACM Symposium on Parallelism in Algorithms and Architectures. Google ScholarDigital Library
- Michael Spear, Luke Dalessandro, Virendra J. Marathe, and Michael L. Scott. 2008. Ordering-based semantics for software transactional memory. In Proceedings of the 12th International Conference on Principles of DIstributed Systems. Google ScholarDigital Library
- Michael Spear, Michael Silverman, Luke Dalessandro, Maged M. Michael, and Michael L. Scott. 2008. Implementing and exploiting inevitability in software transactional memory. In Proceedings of the 37th International Conference on Parallel Processing. Google ScholarDigital Library
- Bjarne Stroustrup. 2012. Foundations of C++ (keynote lecture). In Proceedings of the European Joint Conference on Theory and Practice of Software.Google Scholar
- Takayuki Usui, Yannis Smaragdakis, Reimer Behrends, and Jacob Evans. 2009. Adaptive locks: Combining transactions and locks for efficient concurrency. In Proceedings of the 18th International Conference on Parallel Architecture and Compilation Techniques. Google ScholarDigital Library
- Adam Welc, Bratin Saha, and Ali-Reza Adl-Tabatabai. 2008. Irrevocable transactions and their applications. In Proceedings of the 20th ACM Symposium on Parallelism in Algorithms and Architectures. Munich, Germany. Google ScholarDigital Library
- Richard Yoo, Christopher Hughes, Konrad Lai, and Ravi Rajwar. 2013. Performance evaluation of Intel transactional synchronization extensions for high performance computing. In Proceedings of the International Conference for High Performance Computing, Networking, Storage and Analysis. Google ScholarDigital Library
- Richard Yoo, Yang Ni, Adam Welc, Bratin Saha, Ali-Reza Adl-Tabatabai, and Hsien-Hsin Lee. 2008. Kicking the tires of software transactional memory: Why the going gets tough. In Proceedings of the 20th ACM Symposium on Parallelism in Algorithms and Architectures. Google ScholarDigital Library
- Tingzhe Zhou, Pantea Zardoshti, and Michael Spear. 2017. Practical experience with transactional lock elision. In Proceedings of the 46th International Conference on Parallel Processing.Google ScholarCross Ref
Index Terms
- Simplifying Transactional Memory Support in C++
Recommendations
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 ...
Transactional memory: from semantics to silicon
IWMSE '08: Proceedings of the 1st international workshop on Multicore software engineeringMulti-core architectures bring parallel programming into the mainstream. Parallel programming poses many new challenges to the developer, one of which is synchronizing concurrent access to shared memory by multiple threads. Programmers have ...
Compiler and runtime support for efficient software transactional memory
Proceedings of the 2006 PLDI ConferenceProgrammers have traditionally used locks to synchronize concurrent access to shared data. Lock-based synchronization, however, has well-known pitfalls: using locks for fine-grain synchronization and composing code that already uses locks are both ...
Comments