A speculation‐friendly binary search tree

We introduce the first binary search tree algorithm designed for speculative executions. Prior to this work, tree structures were mainly designed for their pessimistic (non-speculative) accesses to have a bounded complexity. Researchers tried to evaluate transactional memory using such tree structures whose prominent example is the red-black tree library developed by Oracle Labs that is part of multiple benchmark distributions. Although well-engineered, such structures remain badly suited for speculative accesses, whose step complexity might raise dramatically with contention. We show that our speculation-friendly tree outperforms the existing transaction-based version of the AVL and the red-black trees. Its key novelty stems from the decoupling of update operations: they are split into one transaction that modifies the abstraction state and multiple ones that restructure its tree implementation in the background. In particular, the speculation-friendly tree is shown correct, reusable and it speeds up a transaction-based travel reservation application by up to 3.5x.

[1]  M. AdelsonVelskii,et al.  AN ALGORITHM FOR THE ORGANIZATION OF INFORMATION , 1963 .

[2]  Leslie Lamport,et al.  On-the-fly garbage collection: an exercise in cooperation , 1975, CACM.

[3]  Leonidas J. Guibas,et al.  A dichromatic framework for balanced trees , 1978, 19th Annual Symposium on Foundations of Computer Science (sfcs 1978).

[4]  H. T. Kung,et al.  Concurrent manipulation of binary search trees , 1980, TODS.

[5]  Joep L. W. Kessels On-the-fly optimization of data structures , 1983, CACM.

[6]  Richard E. Ladner,et al.  Concurrency control in a dynamic search structure , 1984, TODS.

[7]  Derick Wood,et al.  Concurrency control in database structures with relaxed balance , 1987, PODS '87.

[8]  Adrian Colbrook,et al.  Concurrent Data Structures , 1991, ICCI.

[9]  Eljas Soisalon-Soininen,et al.  Uncoupling updating and rebalancing in chromatic binary search trees , 1991, PODS '91.

[10]  Maurice Herlihy,et al.  Transactional Memory: Architectural Support For Lock-free Data Structures , 1993, Proceedings of the 20th Annual International Symposium on Computer Architecture.

[11]  C. Mohan Commit_LSN: A Novel and Simple Method for Reducing Locking and Latching in Transaction Processing Systems , 1996, Performance of Concurrency Control Mechanisms in Centralized Database Systems.

[12]  Nir Shavit,et al.  Software transactional memory , 1995, PODC '95.

[13]  Xavier Messeguer Peypoch,et al.  Height-relaxed AVL rebalancing: a unified, fine-grained approach to concurrent dictionaries , 1998 .

[14]  James R. Goodman,et al.  Speculative lock elision: enabling highly concurrent multithreaded execution , 2001, MICRO.

[15]  Timothy L. Harris,et al.  A Pragmatic Implementation of Non-blocking Linked-Lists , 2001, DISC.

[16]  Paul E. McKenney,et al.  READ-COPY UPDATE: USING EXECUTION HISTORY TO SOLVE CONCURRENCY PROBLEMS , 2002 .

[17]  Maurice Herlihy,et al.  Software transactional memory for dynamic-sized data structures , 2003, PODC '03.

[18]  Rudolf Bayer,et al.  Symmetric binary B-Trees: Data structure and maintenance algorithms , 1972, Acta Informatica.

[19]  Maurice Herlihy,et al.  Snapshots and software transactional memory , 2005, Sci. Comput. Program..

[20]  Lucia Ballard May Conflict Avoidance : Data Structures in Transactional Memory , 2006 .

[21]  J. Eliot B. Moss Open Nested Transactions: Semantics and Support , 2006 .

[22]  Nir Shavit,et al.  Transactional Locking II , 2006, DISC.

[23]  Bratin Saha,et al.  Open nesting in software transactional memory , 2007, PPOPP.

[24]  Rachid Guerraoui,et al.  On the correctness of transactional memory , 2008, PPoPP.

[25]  D. M. Hutton,et al.  The Art of Multiprocessor Programming , 2008 .

[26]  Safer open-nested transactions through ownership , 2008, PPOPP.

[27]  Maurice Herlihy,et al.  Transactional boosting: a methodology for highly-concurrent transactional objects , 2008, PPoPP.

[28]  Torvald Riegel,et al.  Dynamic performance tuning of word-based software transactional memory , 2008, PPoPP.

[29]  Simon L. Peyton Jones,et al.  Composable memory transactions , 2005, CACM.

[30]  Hsien-Hsin S. Lee,et al.  Kicking the tires of software transactional memory: why the going gets tough , 2008, SPAA '08.

[31]  Kunle Olukotun,et al.  STAMP: Stanford Transactional Applications for Multi-Processing , 2008, 2008 IEEE International Symposium on Workload Characterization.

[32]  P. Felber,et al.  TM UNIT : Testing Software Transactional Memories , 2009 .

[33]  Elastic Transactions , 2009, DISC.

[34]  Kunal Agrawal,et al.  Safe open-nested transactions through ownership , 2009, PPoPP '09.

[35]  Faith Ellen,et al.  Non-blocking binary search trees , 2010, PODC.

[36]  Emmett Witchel,et al.  Is transactional programming actually easier? , 2010, PPoPP '10.

[37]  Kunle Olukotun,et al.  A practical concurrent binary search tree , 2010, PPoPP '10.

[38]  Michael F. Spear,et al.  NOrec: streamlining STM by abolishing ownership records , 2010, PPoPP '10.

[39]  Christof Fetzer,et al.  Extensible transactional memory testbed , 2010, J. Parallel Distributed Comput..

[40]  Nir Shavit,et al.  Flat combining and the synchronization-parallelism tradeoff , 2010, SPAA '10.

[41]  Victor Pankratius,et al.  A study of transactional memory vs. locks in practice , 2011, SPAA '11.

[42]  Rachid Guerraoui,et al.  Why STM can be more than a research toy , 2011, Commun. ACM.

[43]  Nir Shavit Data structures in the multicore age , 2011, CACM.

[44]  Jonathan Walpole,et al.  A Relativistic Enhancement to Software Transactional Memory , 2011, HotPar.

[45]  Nir Shavit,et al.  Towards Consistency Oblivious Programming , 2011, OPODIS.

[46]  Maged M. Michael,et al.  Evaluation of Blue Gene/Q hardware support for transactional memories , 2012, 2012 21st International Conference on Parallel Architectures and Compilation Techniques (PACT).

[47]  M. Frans Kaashoek,et al.  Scalable address spaces using RCU balanced trees , 2012, ASPLOS XVII.

[48]  Improving HTM Scaling with Consistency-Oblivious Programming , 2013 .

[49]  Michel Raynal,et al.  No Hot Spot Non-blocking Skip List , 2013, 2013 IEEE 33rd International Conference on Distributed Computing Systems.

[50]  Rachid Guerraoui,et al.  Democratizing transactional programming , 2014, CACM.