arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2209.07100cs.DCcs.DS
收藏

并发大小

Concurrent Size

Gal Sela, Erez Petrank

摘要:

数据结构的大小(即,其中元素的数量)是数据集的广泛使用的属性。然而,对于并发程序,有效地获得正确的大小是不平凡的。事实上,文献没有提供一种机制来获得正确的(可线性化的)并发数据集的大小而不诉诸低效的解决方案,如采取数据结构的完整快照来计数元素,或在所有更新和大小操作中获取一个全局锁。本文提出了一种在集合和字典中添加并发线性化大小操作的方法,其性能开销相对较低。从理论上讲,建议的大小操作是等待免费的渐近复杂度线性线程的数量(独立的数据结构的大小)。实际上,我们通过向Java中的各种并发数据结构($-$、跳表、哈希表和树)添加大小来评估性能开销。所提出的可线性化大小操作与获取快照的现有选项相比执行快了数量级,同时在原始数据结构的操作上引起$1\%-20\%$的吞吐量损失。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑