Abstract
The release of hardware transactional memory (HTM) in commodity CPUs has major implications on the design and implementation of main-memory databases, especially on the architecture of high-performance lock-free indexing methods at the core of several of these systems. This paper studies the interplay of HTM and lock-free indexing methods. First, we evaluate whether HTM will obviate the need for crafty lock-free index designs by integrating it in a traditional B-tree architecture. HTM performs well for simple data sets with small fixed-length keys and payloads, but its benefits disappear for more complex scenarios (e.g., larger variable-length keys and payloads), making it unattractive as a general solution for achieving high performance. Second, we explore fundamental differences between HTM-based and lock-free B-tree designs. While lock-freedom entails design complexity and extra mechanism, it has performance advantages in several scenarios, especially high-contention cases where readers proceed uncontested (whereas HTM aborts readers). Finally, we explore the use of HTM as a method to simplify lock-free design. We find that using HTM to implement a multi-word compare-and-swap greatly reduces lock-free programming complexity at the cost of only a 10-15% performance degradation. Our study uses two state-of-the-art index implementations: a memory-optimized B-tree extended with HTM to provide multi-threaded concurrency and the Bw-tree lock-free B-tree used in several Microsoft production environments.
- M. Abadi, T. Harris, and M. Mehrara. Transactional Memory with Strong Atomicity Using Off-the-shelf Memory Protection Hardware. In PPoPP, pages 185--196, 2009. Google ScholarDigital Library
- J. H. Anderson and M. Moir. Universal Constructions for Multi-Object Operations. In PODC, pages 184--193, 1995. Google ScholarDigital Library
- C. Blundell, E. C. Lewis, and M. M. Martin. Subtleties of Transactional Memory Atomicity Semantics. IEEE Comput. Archit. Lett., 5(2):--, Feb 2006. Google ScholarDigital Library
- I. Calciu et al. NUMA-Aware Reader-Writer Locks. In PPoPP, pages 157--166, 2013. Google ScholarDigital Library
- I. Calciu et al. Invyswell: A Hybrid Transactional Memory for Haswell's Restricted Transactional Memory. In PACT, pages 187--200, 2014. Google ScholarDigital Library
- J. Chung et al. ASF: AMD64 extension for lock-free data structures and transactional memory. In MICRO, pages 39--50, 2010. Google ScholarDigital Library
- cpp-btree. https://code.google.com/p/cpp-btree/.Google Scholar
- T. Crain, E. Kanellou, and M. Raynal. STM Systems: Enforcing Strong Isolation Between Transactions and Non-transactional Code. In ICA3PP, pages 317--331, 2012. Google ScholarDigital Library
- P. Damron et al. Hybrid Transactional Memory. In ASPLOS, pages 336--346, 2006. Google ScholarDigital Library
- C. Diaconu et al. Hekaton: SQL Server's Memory-Optimized OLTP Engine. In SIGMOD, pages 1243--1254, 2013. Google ScholarDigital Library
- D. Dice et al. Applications of the Adaptive Transactional Memory Test Platform. In TRANSACT Workshop, 2008.Google Scholar
- Azure DocumentDB. https://www.documentdb.com.Google Scholar
- G. Graefe. A Survey of B-tree Locking Techniques. ACM Trans. Database Syst., 35(3):16:1--16:26, 2010. Google ScholarDigital Library
- J. Gray et al. Quickly Generating Billion-record Synthetic Databases. In SIGMOD, pages 243--252, 1994. Google ScholarDigital Library
- S. Harizopoulos et al. OLTP Through the Looking Glass, and What We Found There. In SIGMOD, pages 981--992, 2008. Google ScholarDigital Library
- T. L. Harris et al. A Practical Multi-Word Compare-and-Swap Operation. In Distributed Computing, pages 265--279. 2002. Google ScholarCross Ref
- M. Herlihy and J. E. B. Moss. Transactional Memory: Architectural Support for Lock-Free Data Structures. In ISCA, pages 289--300, 1993. Google ScholarDigital Library
- Intel. Intel 64 and IA-32 Architectures Optimization Reference Manual, September 2014.Google Scholar
- A. Israeli and L. Rappoport. Disjoint-Access-Parallel Implementations of Strong Shared Memory Primitives. In PODC, pages 151--160, 1994. Google ScholarDigital Library
- C. Jacobi et al. Transactional Memory Architecture and Implementation for IBM System z. In MICRO, pages 25--36, 2012. Google ScholarDigital Library
- T. Karnagel et al. Improving In-Memory Database Index Performance with Intel Transactional Synchronization Extensions. In HPCA, pages 476--487, 2014.Google Scholar
- P. L. Lehman and S. B. Yao. Efficient Locking for Concurrent Operations on B-Trees. TODS, 6(4):650--670, 1981. Google ScholarDigital Library
- V. Leis et al. The Adaptive Radix Tree: ARTful Indexing for Main-memory Databases. In ICDE, pages 38--49, 2013. Google ScholarDigital Library
- V. Leis et al. Exploiting Hardware Transactional Memory in Main-Memory Databases. In ICDE, pages 580--591, 2014.Google ScholarCross Ref
- Y. Lev, M. Moir, and D. Nussbaum. PhTM: Phased transactional memory. In Transact, 2007.Google Scholar
- J. Levandoski et al. High Performance Transactions in Deuteronomy. In CIDR, 2015.Google Scholar
- J. Levandoski, D. B. Lomet, and S. Sengupta. The Bw-Tree: A B-tree for New Hardware Platforms. In ICDE, pages 302--313, 2013. Google ScholarDigital Library
- D. B. Lomet. Process Structuring, Synchronization, and Recovery Using Atomic Actions. In Proceedings of the ACM Conference on Language Design for Reliable Software, pages 128--137, 1977. Google ScholarDigital Library
- Y. Mao, E. Kohler, and R. T. Morris. Cache Craftiness for Fast Multicore Key-Value Storage. In EuroSys, pages 183--196, 2012. Google ScholarDigital Library
- The Story Behind MemSQLs Skiplist Indexes. http://blog.memsql.com/the-story-behind-memsqls-skiplist-indexes/.Google Scholar
- C. C. Minh, M. Trautmann, J. Chung, A. McDonald, N. Bronson, J. Casper, C. Kozyrakis, and K. Olukotun. An Effective Hybrid Transactional Memory System with Strong Isolation Guarantees. In ISCA, pages 69--80, 2007. Google ScholarDigital Library
- I. Pandis, P. Tözün, R. Johnson, and A. Ailamaki. PLP: Page Latch-free Shared-everything OLTP. PVLDB, 4(10):610--621, 2011. Google ScholarDigital Library
- R. Rajwar and J. R. Goodman. Speculative Lock Elision: Enabling Highly Concurrent Multithreaded Execution. In MICRO, pages 294--305, 2001. Google ScholarDigital Library
- J. Sewall et al. PALM: Parallel Architecture-Friendly Latch-Free Modifications to B+ Trees on Many-Core Processors. PVLDB, 4(11):795--806, 2011.Google ScholarDigital Library
- N. Shavit and D. Toutitou. Software Transactional Memory. In PODC, pages 204--213, 1995. Google ScholarDigital Library
- V. Srinivasan and M. J. Carey. Performance of B+ Tree Concurrency Algorithms. VLDB Journal, 2(4):361--406, 1993. Google ScholarDigital Library
- R. M. Yoo et al. Performance Evaluation of Intel Transactional Synchronization Extensions for High-Performance Computing. In SC, pages 19--29, 2013. Google ScholarDigital Library
Index Terms
- To lock, swap, or elide: on the interplay of hardware transactional memory and lock-free indexing
Recommendations
To lock, swap, or elide: on the interplay of hardware transactional memory and lock-free indexing
The release of hardware transactional memory (HTM) in commodity CPUs has major implications on the design and implementation of main-memory databases, especially on the architecture of high-performance lock-free indexing methods at the core of several ...
Transactional lock-free execution of lock-based programs
Special Issue: Proceedings of the 10th annual conference on Architectural Support for Programming Languages and Operating SystemsThis paper is motivated by the difficulty in writing correct high-performance programs. Writing shared-memory multi-threaded programs imposes a complex trade-off between programming ease and performance, largely due to subtleties in coordinating access ...
Comments