skip to main content
10.1145/2555243.2555256acmconferencesArticle/Chapter ViewAbstractPublication PagesppoppConference Proceedingsconference-collections
research-article

Fast concurrent lock-free binary search trees

Published: 06 February 2014 Publication History

Abstract

We present a new lock-free algorithm for concurrent manipulation of a binary search tree in an asynchronous shared memory system that supports search, insert and delete operations. In addition to read and write instructions, our algorithm uses (single-word) compare-and-swap (CAS) and bit-test-and-set (SETB) atomic instructions, both of which are commonly supported by many modern processors including Intel~64 and AMD64.
In contrast to existing lock-free algorithms for a binary search tree, our algorithm is based on marking edges rather than nodes. As a result, when compared to other lock-free algorithms, modify (insert and delete) operations in our algorithm work on a smaller portion of the tree, thereby reducing conflicts, and execute fewer atomic instructions (one for insert and three for delete). Our experiments indicate that our lock-free algorithm significantly outperforms all other algorithms for a concurrent binary search tree in many cases, especially when contention is high, by as much as 100%.

References

[1]
M. A. Bender, J. T. Fineman, S. Gilbert, and B. C. Kuszmaul. Concurrent Cache-Oblivious B-Trees. In Proceedings of the 17th ACM Symposium on Parallelism in Algorithms and Architectures (SPAA), pages 228--237, July 2005.
[2]
A. Braginsky and E. Petrank. A Lock-Free B+ tree. In Proceedings of the 24th ACM Symposium on Parallelism in Algorithms and Architectures (SPAA), pages 58--67, 2012.
[3]
N. G. Bronson, J. Casper, H. Chafi, and K. Olukotun. A Practical Concurrent Binary Search Tree. In Proceedings of the 15th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming (PPoPP), pages 257--268, Jan. 2010.
[4]
T. Brown and J. Helga. Non-Blocking k-ary Search Trees. In Proceedings of the International Conference on Principles of Distributed Systems (OPODIS), pages 207--221, 2011.
[5]
T. Brown, F. Ellen, and E. Ruppert. Pragmatic Primitives for Non-blocking Data Structures. In Proceedings of the33rdACM Symposium on Principles of Distributed Computing (PODC), pages 207--221, 2013.
[6]
T. Brown, F. Ellen, and E. Ruppert. A General Technique for Non-blocking Trees. In Proceedings of the 19th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming (PPoPP), 2014.
[7]
B.Wicht. Binary Trees Implementations Comparison for Multicore Programming. Technical report, Switzerland HES-SO University of Applied Science, June 2012. Code available at: https://github.com/wichtounet/btrees/.
[8]
P. Chuong, F. Ellen, and V. Ramachandran. A Universal Construction for Wait-Free Transaction Friendly Data Structures. In Proceedings of the 22nd ACM Symposium on Parallelism in Algorithms and Architectures (SPAA), pages 335--344, 2010.
[9]
T. H. Cormen, C. E. Leiserson, and R. L. Rivest. Introduction to Algorithms. The MIT Press, 1991.
[10]
T. Crain, V. Gramoli, and M. Raynal. A Contention-Friendly Binary Search Tree. In Proceedings of the European Conference on Parallel and Distributed Computing (Euro-Par), pages 229--240, Aachen, Germany, 2013.
[11]
D. Drachsler, M. Vechev, and E. Yahav. Practical Concurrent Binary Search Trees via Logical Ordering. In Proceedings of the 19th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming (PPoPP), Orlando, Florida, USA, Feb. 2014.
[12]
F. Ellen, P. Fataourou, E. Ruppert, and F. van Breugel. Non-Blocking Binary Search Trees. In Proceedings of the 29th ACM Symposium on Principles of Distributed Computing (PODC), pages 131--140, July 2010.
[13]
P. Fatourou and N. D. Kallimanis. A Highly-Efficient Wait-Free Universal Construction. In Proceedings of the 23rd ACM Symposium on Parallelism in Algorithms and Architectures (SPAA), pages 325--334, 2011.
[14]
M. Fomitchev and E. Ruppert. Lock-Free Linked Lists and Skiplists. In Proceedings of the 23rd ACM Symposium on Principles of Distributed Computing (PODC), pages 50--59, July 2004.
[15]
K. Fraser and T. L. Harris. Concurrent Programming Without Locks. ACM Transactions on Computer Systems, 25 (2), May 2007.
[16]
S. Ghemawat and P. Menage. TCMalloc: Thread-Caching Malloc. URL http://goog-perftools.sourceforge.net/doc/tcmalloc.html.
[17]
T. Harris. A Pragmatic Implementation of Non-blocking Linked-lists. Distributed Computing (DC), pages 300--314, 2001.
[18]
M. Herlihy. Wait-Free Synchronization. ACM Transactions on Programming Languages and Systems (TOPLAS), 13 (1): 124--149, Jan. 1991.
[19]
M. Herlihy. A Methodology for Implementing Highly Concurrent Objects. ACM Transactions on Programming Languages and Systems (TOPLAS), 15 (5): 745--770, 1993.
[20]
M. Herlihy and N. Shavit. The Art of Multiprocessor Programming, Revised Reprint. Morgan Kaufmann, 2012.
[21]
M. Herlihy and J. M. Wing. Linearizability: A Correctness Condition for Concurrent Objects. ACM Transactions on Programming Languages and Systems (TOPLAS), 12 (3): 463--492, July 1990.
[22]
M. Herlihy, V. Luchangco, and M. Moir. Obstruction-Free Synchronization: Double-Ended Queues as an Example. In Proceedings of the 23rd IEEE International Conference on Distributed Computing Systems (ICDCS), pages 522--529, 2003.
[23]
S. V. Howley and J. Jones. A Non-Blocking Internal Binary Search Tree. In Proceedings of the 24th ACM Symposium on Parallelism in Algorithms and Architectures (SPAA), pages 161--171, June 2012.
[24]
J. H. Kim, H. Cameron, and P. Graham. Lock-Free Red-Black Trees Using CAS. Concurrency and Computation: Practice and Experience, pages 1--40, 2006.
[25]
M. M. Michael. High Performance Dynamic Lock-Free Hash Tables and List-based Sets. In Proceedings of the 14th ACM Symposium on Parallelism in Algorithms and Architectures (SPAA), pages 73--82, 2002.
[26]
M. M. Michael. Hazard Pointers: Safe Memory Reclamation for Lock-Free Objects. IEEE Transactions on Parallel and Distributed Systems (TPDS), 15 (6): 491--504, 2004.
[27]
A. Natarajan and N. Mittal. Brief Announcement: A Concurrent Lock-Free Red-Black Tree. In Proceedings of the 27th Symposium on Distributed Computing (DISC), Jerusalem, Israel, Oct. 2013.
[28]
A. Natarajan, L. H. Savoie, and N. Mittal. Concurrent Wait-Free Red-Black Trees. In Proceedings of the 15th International Symposium on Stabilization, Safety, and Security of Distributed Systems (SSS), pages 45--60, Osaka, Japan, Nov. 2013.
[29]
A. Prokopec, N. G. Bronson, P. Bagwell, and M. Odersky. Concurrent Tries with Efficient Non-Blocking Snapshots. In Proceedings of the 17th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming (PPoPP), pages 151--160, 2012.
[30]
N. Shafiei. Non-blocking Patricia Tries with Replace Operations. In Proceedings of the 33rd IEEE International Conference on Distributed Computing Systems (ICDCS), pages 216--225, JUL 2013.
[31]
H. Sundell and P. Tsigas. Scalable and Lock-Free Concurrent Dictionaries. In Proceedings of the 19th Annual Symposium on Selected Areas in Cryptography, pages 1438--1445, Mar. 2004.

Cited By

View all
  • (2025)Concurrent and Learned Data StructuresProceedings of the 26th International Conference on Distributed Computing and Networking10.1145/3700838.3703693(430-434)Online publication date: 4-Jan-2025
  • (2025)Distributing Context-Aware Shared Memory Data Structures: A Case Study on Singly-Linked ListsProceedings of the 26th International Conference on Distributed Computing and Networking10.1145/3700838.3703659(280-281)Online publication date: 4-Jan-2025
  • (2025)COREC: Concurrent non-blocking single-queue receive driver for low latency networkingComputer Networks10.1016/j.comnet.2024.110982258(110982)Online publication date: Feb-2025
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
PPoPP '14: Proceedings of the 19th ACM SIGPLAN symposium on Principles and practice of parallel programming
February 2014
412 pages
ISBN:9781450326568
DOI:10.1145/2555243
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 06 February 2014

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. binary search tree
  2. concurrent data structure
  3. lock-free algorithm

Qualifiers

  • Research-article

Conference

PPoPP '14
Sponsor:

Acceptance Rates

PPoPP '14 Paper Acceptance Rate 28 of 184 submissions, 15%;
Overall Acceptance Rate 230 of 1,014 submissions, 23%

Upcoming Conference

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)171
  • Downloads (Last 6 weeks)12
Reflects downloads up to 18 Feb 2025

Other Metrics

Citations

Cited By

View all
  • (2025)Concurrent and Learned Data StructuresProceedings of the 26th International Conference on Distributed Computing and Networking10.1145/3700838.3703693(430-434)Online publication date: 4-Jan-2025
  • (2025)Distributing Context-Aware Shared Memory Data Structures: A Case Study on Singly-Linked ListsProceedings of the 26th International Conference on Distributed Computing and Networking10.1145/3700838.3703659(280-281)Online publication date: 4-Jan-2025
  • (2025)COREC: Concurrent non-blocking single-queue receive driver for low latency networkingComputer Networks10.1016/j.comnet.2024.110982258(110982)Online publication date: Feb-2025
  • (2024)Concurrent Immediate Reference CountingProceedings of the ACM on Programming Languages10.1145/36563838:PLDI(151-174)Online publication date: 20-Jun-2024
  • (2024)ScaleCache: A Scalable Page Cache for Multiple Solid-State DrivesProceedings of the Nineteenth European Conference on Computer Systems10.1145/3627703.3629588(641-656)Online publication date: 22-Apr-2024
  • (2024)Practical Hardware Transactional vEB TreesProceedings of the 29th ACM SIGPLAN Annual Symposium on Principles and Practice of Parallel Programming10.1145/3627535.3638504(215-228)Online publication date: 2-Mar-2024
  • (2024)CPMA: An Efficient Batch-Parallel Compressed Set Without PointersProceedings of the 29th ACM SIGPLAN Annual Symposium on Principles and Practice of Parallel Programming10.1145/3627535.3638492(348-363)Online publication date: 2-Mar-2024
  • (2024)Scaling Up Transactions with Slower ClocksProceedings of the 29th ACM SIGPLAN Annual Symposium on Principles and Practice of Parallel Programming10.1145/3627535.3638472(2-16)Online publication date: 2-Mar-2024
  • (2024)Expediting Hazard Pointers with Bounded RCU Critical SectionsProceedings of the 36th ACM Symposium on Parallelism in Algorithms and Architectures10.1145/3626183.3659941(1-13)Online publication date: 17-Jun-2024
  • (2024)Skip It: Take Control of Your Cache!Proceedings of the 29th ACM International Conference on Architectural Support for Programming Languages and Operating Systems, Volume 210.1145/3620665.3640407(1077-1094)Online publication date: 27-Apr-2024
  • Show More Cited By

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media