In Proceedings

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

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.

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

Venue: PPOPP 2013:261-270


Hardware and Software, Engineered to Work Together