paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Concurrent size

并发 size 操作
OOPSLA 6(OOPSLA2)2022匹配度 1/10 · 该论文研究并发数据结构的线性一致、wait-free size 操作,属于并发/并行与内存模型方向,但未涉及用户画像中的静态分析、LLM/Agent、浮点程序分析或贝叶斯程序分析等核心主题。引用 3 inbox
Gal Sela, Erez Petrank
crossref: 2026-09-10

AI 速览

一句话:提出为并发集合与字典添加线性一致、wait-free 的 size 操作的方法,性能开销低。

并发程序中高效获得数据结构正确大小(元素个数)并非易事:已有方案要么对数据结构做完整快照来计数,要么在所有更新和 size 操作上加全局锁,效率低下。本文提出一种为集合与字典添加并发线性一致 size 操作的方法。理论上,该 size 操作是 wait-free 的,其渐近复杂度与线程数线性相关,且与数据结构规模无关。实践上,作者在 Java 中为跳表、哈希表与树等多种并发数据结构加入 size 操作并评估性能。与快照方案相比,所提线性一致 size 操作的执行速度快数个数量级,同时对原数据结构操作的吞吐量仅造成 1%–20% 的损失。

问题
并发程序缺乏高效机制来获得数据结构线性一致的大小(元素个数),现有快照或全局锁方案效率低下。
方法
提出一种为并发集合与字典添加线性一致 size 操作的方法,该操作 wait-free,渐近复杂度与线程数线性相关且与数据结构规模无关。
评估
在 Java 中为跳表、哈希表和树等并发数据结构实现 size 操作,并与快照方案对比,测量执行速度与原操作吞吐量开销。
原文摘要(Abstract)

The size of a data structure (i.e., the number of elements in it) is a widely used property of a data set. However, for concurrent programs, obtaining a correct size efficiently is non-trivial. In fact, the literature does not offer a mechanism to obtain a correct (linearizable) size of a concurrent data set without resorting to inefficient solutions, such as taking a full snapshot of the data structure to count the elements, or acquiring one global lock in all update and size operations. This paper presents a methodology for adding a concurrent linearizable size operation to sets and dictionaries with a relatively low performance overhead. Theoretically, the proposed size operation is wait-free with asymptotic complexity linear in the number of threads (independently of data-structure size). Practically, we evaluated the performance overhead by adding size to various concurrent data structures in Java−a skip list, a hash table and a tree. The proposed linearizable size operation executes faster by orders of magnitude compared to the existing option of taking a snapshot, while incurring a throughput loss of 1%−20% on the original data structure’s operations.

链接与引用

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

BibTeX
@article{paperbot1419,
  title = {Concurrent size},
  author = {Gal Sela and Erez Petrank},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {6},
  number = {OOPSLA2},
  year = {2022},
  doi = {10.1145/3563300}
}