Distributed Computing

, Volume 27, Issue 6, pp 393–417

The CB tree: a practical concurrent self-adjusting search tree

  • Yehuda Afek
  • Haim Kaplan
  • Boris Korenfeld
  • Adam Morrison
  • Robert E. Tarjan
Article

DOI: 10.1007/s00446-014-0229-0

Cite this article as:
Afek, Y., Kaplan, H., Korenfeld, B. et al. Distrib. Comput. (2014) 27: 393. doi:10.1007/s00446-014-0229-0
  • 231 Downloads

Abstract

We present the CB tree, a counting-based self-adjusting binary search tree in which, as in splay trees, more-frequently accessed items move closer to the root. In a sequential execution, after \(m\) operations of which \(c(v)\) access item \(v\), an access of \(v\) traverses a path of length \(\mathcal {O}\left( 1 + \log \frac{m}{c(v)}\right) \) while doing few if any rotations. Unlike the original splay tree, in which each access moves the accessed item all the way to the root via a sequence of rotations, accesses in a CB tree do very few rotations, specifically \(\mathcal {O}\left( n + n\log \frac{m}{n}\right) \), during a sequence of \(m\) operations of which \(n\) are insertions. This is \(o(1)\) (subconstant) amortized per operation if \(m \gg n\). We adapt the CB tree into a scalable concurrent self-adjusting BST. We show experimentally that the concurrent CB tree scales well because it, too, performs few rotations, and therefore self-adjusts without having rotations create a bottleneck. Our evaluation shows that the concurrent CB tree performs better than existing concurrent search trees on non-uniform access sequences derived from real workloads.

Keywords

Self-adjusting tree Splay tree Optimistic concurrency control 

Copyright information

© Springer-Verlag Berlin Heidelberg 2014

Authors and Affiliations

  • Yehuda Afek
    • 1
  • Haim Kaplan
    • 1
  • Boris Korenfeld
    • 1
  • Adam Morrison
    • 1
  • Robert E. Tarjan
    • 2
    • 3
  1. 1.Blavatnik School of Computer ScienceTel Aviv UniversityTel AvivIsrael
  2. 2.Department of Computer SciencePrinceton UniversityPrincetonUSA
  3. 3.Microsoft ResearchMountain ViewUSA