A lazy concurrent list-based set algorithm

  • Authors:
  • Steve Heller;Maurice Herlihy;Victor Luchangco;Mark Moir;William N. Scherer;Nir Shavit

  • Affiliations:
  • Sun Microsystems Laboratories;Brown University;Sun Microsystems Laboratories;Sun Microsystems Laboratories;University of Rochester;Sun Microsystems Laboratories

  • Venue:
  • OPODIS'05 Proceedings of the 9th international conference on Principles of Distributed Systems
  • Year:
  • 2005

Quantified Score

Hi-index 0.02

Visualization

Abstract

List-based implementations of sets are a fundamental building block of many concurrent algorithms. A skiplist based on the lock-free list-based set algorithm of Michael will be included in the JavaTM Concurrency Package of JDK 1.6.0. However, Michael's lock-free algorithm has several drawbacks, most notably that it requires all list traversal operations, including membership tests, to perform cleanup operations of logically removed nodes, and that it uses the equivalent of an atomically markable reference, a pointer that can be atomically “marked,” which is expensive in some languages and unavailable in others. We present a novel “lazy” list-based implementation of a concurrent set object. It is based on an optimistic locking scheme for inserts and removes, eliminating the need to use the equivalent of an atomically markable reference. It also has a novel wait-free membership test operation (as opposed to Michael's lock-free one) that does not need to perform cleanup operations and is more efficient than that of all previous algorithms. Empirical testing shows that the new lazy-list algorithm consistently outperforms all known algorithms, including Michael's lock-free algorithm, throughout the concurrency range. At high load, with 90% membership tests, the lazy algorithm is more than twice as fast as Michael's. This is encouraging given that typical search structure usage patterns include around 90% membership tests. By replacing the lock-free membership test of Michael's algorithm with our new wait-free one, we achieve an algorithm that slightly outperforms our new lazy-list (though it may not be as efficient in other contexts as it uses Java's RTTI mechanism to create pointers that can be atomically marked).