CBTree: A Practical Concurrent Self-Adjusting Search Tree

  • Yehuda Afek
  • Haim Kaplan
  • Boris Korenfeld
  • Adam Morrison
  • Robert E. Tarjan
Part of the Lecture Notes in Computer Science book series (LNCS, volume 7611)


We present the CBTree, a new counting-based self-adjusting binary search tree that, like splay trees, moves more frequently accessed nodes closer to the root. After m operations on n items, c of which access some item v, an operation on v traverses a path of length \(\mathcal{O}(\log\dfrac{m}{c})\) while performing few if any rotations. In contrast to the traditional self-adjusting splay tree in which each accessed item is moved to the root through a sequence of tree rotations, the CBTree performs rotations infrequently (an amortized subconstant o(1) per operation if m ≫ n), mostly at the bottom of the tree. As a result, the CBTree scales with the amount of concurrency. We adapt the CBTree to a multicore setting and show experimentally that it improves performance compared to existing concurrent search trees on non-uniform access sequences derived from real workloads.


Search Tree Access Pattern Cache Line Binary Search Tree Single Rotation 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Gill, P., Arlitt, M., Li, Z., Mahanti, A.: YouTube traffic characterization: a view from the edge. In: Proceedings of the 7th ACM SIGCOMM Conference on Internet Measurement, IMC 2007, pp. 15–28. ACM, New York (2007)CrossRefGoogle Scholar
  2. 2.
    Mahanti, A., Williamson, C., Eager, D.: Traffic analysis of a web proxy caching hierarchy. IEEE Network 14(3), 16–23 (2000)CrossRefGoogle Scholar
  3. 3.
    Cherkasova, L., Gupta, M.: Analysis of enterprise media server workloads: access patterns, locality, content evolution, and rates of change. IEEE/ACM Transactions on Networking 12(5), 781–794 (2004)CrossRefGoogle Scholar
  4. 4.
    Sripanidkulchai, K., Maggs, B., Zhang, H.: An analysis of live streaming workloads on the internet. In: Proceedings of the 4th ACM SIGCOMM Conference on Internet Measurement, IMC 2004, pp. 41–54. ACM, New York (2004)CrossRefGoogle Scholar
  5. 5.
    Bronson, N.G., Casper, J., Chafi, H., Olukotun, K.: A practical concurrent binary search tree. In: Proceedings of the 15th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming, PPoPP 2010, pp. 257–268. ACM, New York (2010)CrossRefGoogle Scholar
  6. 6.
    Hanke, S., Ottmann, T., Soisalon-soininen, E.: Relaxed Balanced Red-black Trees. In: Bongiovanni, G., Bovet, D.P., Di Battista, G. (eds.) CIAC 1997. LNCS, vol. 1203, pp. 193–204. Springer, Heidelberg (1997)CrossRefGoogle Scholar
  7. 7.
    Sleator, D.D., Tarjan, R.E.: Self-adjusting binary search trees. Journal of the ACM 32, 652–686 (1985)MathSciNetzbMATHCrossRefGoogle Scholar
  8. 8.
    Knuth, D.E.: The Art of Computer Programming, Volume 3: Sorting and Searching. Addison Wesley Longman Publishing Co., Inc., Redwood CityGoogle Scholar
  9. 9.
    Seidel, R., Aragon, C.R.: Randomized search trees. Algorithmica 16, 464–497 (1996), doi:10.1007/s004539900061MathSciNetzbMATHCrossRefGoogle Scholar
  10. 10.
    Nievergelt, J., Reingold, E.M.: Binary search trees of bounded balance. In: Proceedings of the Fourth Annual ACM Symposium on Theory of Computing, STOC 1972, pp. 137–142. ACM, New York (1972)CrossRefGoogle Scholar
  11. 11.
    Bent, S.W., Sleator, D.D., Tarjan, R.E.: Biased 2-3 trees. In: Proceedings of the 21st Annual Symposium on Foundations of Computer Science, FOCS 1980, pp. 248–254. IEEE Computer Society, Washington, DC (1980)CrossRefGoogle Scholar
  12. 12.
    Feigenbaum, J., Tarjan, R.E.: Two new kinds of biased search trees. Bell System Technical Journal 62, 3139–3158 (1983)MathSciNetzbMATHGoogle Scholar
  13. 13.
    Baer, J.L.: Weight-balanced trees. In: American Federation of Information Processing Societies: 1975 National Computer Conference, AFIPS 1975, pp. 467–472. ACM, New York (1975)Google Scholar
  14. 14.
    Ellen, F., Fatourou, P., Ruppert, E., van Breugel, F.: Non-blocking binary search trees. In: Proceeding of the 29th ACM SIGACT-SIGOPS Symposium on Principles of Distributed Computing, PODC 2010, pp. 131–140. ACM, New York (2010)CrossRefGoogle Scholar
  15. 15.
    Crain, T., Gramoli, V., Raynal, M.: A speculation-friendly binary search tree. In: Proceedings of the 17th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming, PPoPP 2012, pp. 161–170. ACM, New York (2012)CrossRefGoogle Scholar
  16. 16.
    Pugh, W.: Skip lists: a probabilistic alternative to balanced trees. Communications of the ACM 33, 668–676 (1990)CrossRefGoogle Scholar
  17. 17.
    Tarjan, R.E.: Amortized computational complexity. SIAM Journal on Algebraic and Discrete Methods 6(2), 306–318 (1985)MathSciNetzbMATHCrossRefGoogle Scholar
  18. 18.
    Afek, Y., Kaplan, H., Korenfeld, B., Morrison, A., Tarjan, R.E.: CBTree: A practical concurrent self-adjusting search tree. Technical report (2012)Google Scholar
  19. 19.
    Bayer, R., Schkolnick, M.: Concurrency of operations on b-trees. In: Readings in Database Systems, pp. 129–139. Morgan Kaufmann Publishers Inc., San Francisco (1988)Google Scholar
  20. 20.
    Herlihy, M.P., Wing, J.M.: Linearizability: a correctness condition for concurrent objects. ACM Transactions on Programming Languages and Systems (TOPLAS) 12, 463–492 (1990)CrossRefGoogle Scholar
  21. 21.
    Sleator, D.D.: Splay tree implementation,
  22. 22.
    Project Gutenberg,
  23. 23.
    kc claffy, Andersen, D., Hick, P.: The CAIDA anonymized 2011 internet traces,
  24. 24.
    Zink, M., Suh, K., Gu, Y., Kurose, J.: Watch global, cache local: YouTube network traffic at a campus network - measurements and implications. In: Proceeding of the 15th SPIE/ACM Multimedia Computing and Networking Conference, vol. 6818 (2008)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2012

Authors and Affiliations

  • Yehuda Afek
    • 1
  • Haim Kaplan
    • 1
  • Boris Korenfeld
    • 1
  • Adam Morrison
    • 1
  • Robert E. Tarjan
    • 2
  1. 1.Blavatnik School of Computer ScienceTel Aviv UniversityIsrael
  2. 2.Princeton University and HP LabsChina

Personalised recommendations