Using hardware transactional memory to correct and simplify and readers-writer lock algorithm

  • Authors:
  • Dave Dice;Yossi Lev;Yujie Liu;Victor Luchangco;Mark Moir

  • Affiliations:
  • Oracle Labs, Burlington, MA, USA;Oracle Labs, Burlington, MA, USA;Lehigh University, Bethlehem, PA, USA;Oracle Labs, Burlington, MA, USA;Oracle Labs, Burlington, MA, USA

  • Venue:
  • Proceedings of the 18th ACM SIGPLAN symposium on Principles and practice of parallel programming
  • Year:
  • 2013

Quantified Score

Hi-index 0.00

Visualization

Abstract

Designing correct synchronization algorithms is notoriously difficult, as evidenced by a bug we have identified that has apparently gone unnoticed in a well-known synchronization algorithm for nearly two decades. We use hardware transactional memory (HTM) to construct a corrected version of the algorithm. This version is significantly simpler than the original and furthermore improves on it by eliminating usage constraints and reducing space requirements. Performance of the HTM-based algorithm is competitive with the original in "normal" conditions, but it does suffer somewhat under heavy contention. We successfully apply some optimizations to help close this gap, but we also find that they are incompatible with known techniques for improving progress properties. We discuss ways in which future HTM implementations may address these issues. Finally, although our focus is on how effectively HTM can correct and simplify the algorithm, we also suggest bug fixes and workarounds that do not depend on HTM.