paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Leveraging Immutability to Validate Hazard Pointers for Optimistic Traversals

利用不可变性为乐观遍历验证 Hazard Pointer
PLDI 9(PLDI)2025匹配度 2/10 · 该论文属于并发数据结构与内存回收的形式化验证,使用 Rocq/Iris 证明 Hazard Pointer 验证策略的安全性;但它不涉及用户核心方向中的 PL 与 AI/LLM 交叉、静态分析在 ML/Agent 系统中的应用、浮点程序分析或贝叶斯程序分析。仅有“形式化验证”与用户对理论+工程实现的偏好有弱关联。引用 2 inbox
Janggun Lee, Jeonghyeon Kim, Jeehoon Kang
crossref: 2026-09-10

AI 速览

一句话:提出利用标记节点不可变性的 Hazard Pointer 验证策略,支持乐观遍历的无锁结构,并在 Rocq/Iris 中证明其安全性。

Hazard pointer(HP)是并发数据结构中最早的手工内存回收算法之一,其内存开销有界、鲁棒性强:线程在访问节点前先宣告保护,然后验证该节点仍可从根到达,以确认没有其他线程错过宣告而将其回收。对基于遍历的数据结构,常用做法是基于标记(marking)的验证:未标记节点及其后继仍可达因而安全,已标记节点则不安全。但该策略无法用于会跳过已标记节点的乐观遍历。本文提出一种面向乐观遍历无锁结构(链表、树、跳表等)的新型 HP 验证策略,核心思想是利用已标记节点的不可变性,通过只检查最近一个未标记节点的可达性,一次性验证其后所有已标记节点的可达性。作者在 Rocq 中基于 Iris 分离逻辑框架机器化证明了采用该策略保护的 Harris 链表的安全性,并在实验上表明,对具有乐观遍历的数据结构,其性能与当前最先进的回收算法相当,同时保持简单与鲁棒。

问题
现有基于标记的 Hazard Pointer 验证策略要求被标记(待摘除)的节点不可遍历,因而无法支持会跳过已标记节点的乐观遍历,导致乐观无锁数据结构难以安全地回收内存。
方法
利用已标记节点一旦被标记后其内容不可变这一性质,只验证最近一个未标记节点的可达性,即一次性覆盖其后所有已标记节点的可达性;并用 Rocq 中的 Iris 分离逻辑对 Harris 链表的形式化安全性进行机器化证明。
评估
对基于乐观遍历的数据结构进行性能测量,表明该策略与最先进的回收算法性能相当,同时保持实现简单与鲁棒;并通过 Rocq/Iris 的机器化证明确认其正确性。
原文摘要(Abstract)

Hazard pointers (HP) is one of the earliest manual memory reclamation algorithms for concurrent data structures. It is widely used for its robustness: memory overhead is bounded ( e.g ., by the number of threads). To access a node, threads first announce the protection of each to-be-accessed node, which prevents its reclamation. After announcement, they validate the node’s reachability from the root to ensure that no threads have missed the announcement and reclaimed it. Traversal-based data structures typically use a marking-based validation strategy. This strategy uses a node’s mark to indicate whether the node is to be detached. Unmarked nodes are considered safe to traverse as both the node and its successors are still reachable, while marked nodes are considered unsafe. However, this strategy is inapplicable to the efficient optimistic traversal strategy that skips over marked nodes. We propose a new validation strategy for HP that supports lock-free data structures with optimistic traversal, such as lists, trees, and skip lists. The key idea is to exploit the immutability of marked nodes, and validate their reachability at once by checking the reachability of the most recent unmarked node . To ensure correctness, we prove the safety of Harris’s list protected with the new strategy in Rocq using the Iris separation logic framework. We show that the new strategy’s performance is competitive with state-of-the-art reclamation algorithms when applied to data structures with optimistic traversal, while remaining simple and robust.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@article{paperbot3108,
  title = {Leveraging Immutability to Validate Hazard Pointers for Optimistic Traversals},
  author = {Janggun Lee and Jeonghyeon Kim and Jeehoon Kang},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {9},
  number = {PLDI},
  year = {2025},
  doi = {10.1145/3729247}
}