Table of Contents
Fetching ...

Fixing non-blocking data structures for better compatibility with memory reclamation schemes

Md Amit Hasan Arovi, Ruslan Nikolaev

TL;DR

This work tackles the incompatibility of optimistic traversals in non-blocking data structures with memory reclamation schemes such as Hazard Pointers, Hazard Eras, Interval-Based Reclamation, and Hyaline. It introduces Safe Concurrent Optimistic Traversals (SCOT), a method that adapts data structures (not SMR APIs) to preserve safety and progress while maintaining performance near that of epoch-based reclamation. The authors implement SCOT for Harris' List and Natarajan-Mittal Tree, proving correctness through invariants and ensuring bounded memory overhead and lock-free progress under multiple SMRs. Empirical evaluation shows that SCOT-based implementations achieve high throughput and competitive memory usage, often approaching EBR’s performance, with recovery optimizations reducing restarts and improving scalability across core counts and key ranges.

Abstract

We present a new technique, Safe Concurrent Optimistic Traversals (SCOT), to address a well-known problem related to optimistic traversals with both classical and more recent memory reclamation schemes, such as Hazard Pointers (HP), Hazard Eras (HE), Interval-Based Reclamation (IBR), and Hyaline. Unlike Epoch-Based Reclamation (EBR), these schemes guarantee protection against stalled threads (robustness) but lack support for well-known data structures with optimistic traversals such as Harris' original list, Natarajan-Mittal tree, among others. For these reclamation schemes, existing data structure implementations are either buggy (e.g., Natarajan-Mittal tree) or come with performance trade-offs (e.g., Harris-Michael modified list). A recent work, HP++, supports optimistic traversals but uses a different API and is generally slower than even HP, not to mention more recent schemes such as IBR or Hyaline. Moreover, it has undesirable applicability trade-offs, and more complex implementation, among other issues. We propose a different method which keeps existing reclamation schemes intact but instead relies on data structure adaptations. Unlike existing Harris-Michael approach or HP++, our method retains performance benefits of the original data structure and also does not compromise performance of the underlying reclamation scheme. In fact, for IBR and Hyaline, our results almost match those of EBR, which often serves as a practical upper bound due to its great performance. We implement and evaluate two fundamentally different data structures: Harris' list and Natarajan-Mittal tree. SCOT enables their first correct implementations with optimistic traversals for HP, HE, IBR, and Hyaline.

Fixing non-blocking data structures for better compatibility with memory reclamation schemes

TL;DR

This work tackles the incompatibility of optimistic traversals in non-blocking data structures with memory reclamation schemes such as Hazard Pointers, Hazard Eras, Interval-Based Reclamation, and Hyaline. It introduces Safe Concurrent Optimistic Traversals (SCOT), a method that adapts data structures (not SMR APIs) to preserve safety and progress while maintaining performance near that of epoch-based reclamation. The authors implement SCOT for Harris' List and Natarajan-Mittal Tree, proving correctness through invariants and ensuring bounded memory overhead and lock-free progress under multiple SMRs. Empirical evaluation shows that SCOT-based implementations achieve high throughput and competitive memory usage, often approaching EBR’s performance, with recovery optimizations reducing restarts and improving scalability across core counts and key ranges.

Abstract

We present a new technique, Safe Concurrent Optimistic Traversals (SCOT), to address a well-known problem related to optimistic traversals with both classical and more recent memory reclamation schemes, such as Hazard Pointers (HP), Hazard Eras (HE), Interval-Based Reclamation (IBR), and Hyaline. Unlike Epoch-Based Reclamation (EBR), these schemes guarantee protection against stalled threads (robustness) but lack support for well-known data structures with optimistic traversals such as Harris' original list, Natarajan-Mittal tree, among others. For these reclamation schemes, existing data structure implementations are either buggy (e.g., Natarajan-Mittal tree) or come with performance trade-offs (e.g., Harris-Michael modified list). A recent work, HP++, supports optimistic traversals but uses a different API and is generally slower than even HP, not to mention more recent schemes such as IBR or Hyaline. Moreover, it has undesirable applicability trade-offs, and more complex implementation, among other issues. We propose a different method which keeps existing reclamation schemes intact but instead relies on data structure adaptations. Unlike existing Harris-Michael approach or HP++, our method retains performance benefits of the original data structure and also does not compromise performance of the underlying reclamation scheme. In fact, for IBR and Hyaline, our results almost match those of EBR, which often serves as a practical upper bound due to its great performance. We implement and evaluate two fundamentally different data structures: Harris' list and Natarajan-Mittal tree. SCOT enables their first correct implementations with optimistic traversals for HP, HE, IBR, and Hyaline.

Paper Structure

This paper contains 30 sections, 7 theorems, 19 figures, 1 table.

Key Result

Lemma 1

In Harris' list and NM tree, nodes are always unlinked starting from the head of logically deleted chains. This prevents:

Figures (19)

  • Figure 1: Unsafe optimistic traversal of Harris' linked list with HP: accessing the first logically deleted node (N2) is safe but subsequent nodes may cause SEGFAULTs.
  • Figure 2: Harris' Linked List with optimistic traversals (ignoring memory reclamation).
  • Figure 3: Natarajan-Mittal tree: entire tagged edges can be removed.
  • Figure 4: SCOT for Harris' list using HP reclamation: showing a new version of Do_Find only.
  • Figure 5: SCOT for Harris' list: validating *prev = prev_next at every iteration while traversing through the dangerous zone.
  • ...and 14 more figures

Theorems & Definitions (13)

  • Lemma 1: Ordered Node Removal
  • Lemma 2: Bounded Memory Overhead
  • proof
  • Theorem 1: HP Compatibility & Traversal Safety
  • proof
  • Theorem 2: ABA Prevention
  • proof
  • Theorem 3: Lock-Freedom of Harris’ List
  • proof
  • Theorem 4: NM Tree Traversal Safety
  • ...and 3 more