Thread-Safe priority queues in haskell based on skiplists

  • Authors:
  • Michael Lesniak

  • Affiliations:
  • Research Group Programming Languages / Methodologies, University of Kassel, Kassel, Germany

  • Venue:
  • TFP'11 Proceedings of the 12th international conference on Trends in Functional Programming
  • Year:
  • 2011

Quantified Score

Hi-index 0.00

Visualization

Abstract

Although thread-safe priority queues are fundamental building blocks for many parallel algorithms, there are currently no scalable implementations available in Haskell. An efficient structure to implement priority queues is the skiplist, which is a multi-level linked list with shortcuts. We developed three thread-safe skiplist variants, based on locks, software transactional memory, and atomic compare-and-swap, respectively. In our benchmarks, the lock-based and compare-and-swap variants scaled about equally well, while the transactional variant was by several orders of magnitude slower.