arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2405.06208cs.DS
收藏

一种无锁二叉Trie

A Lock-free Binary Trie

Jeremy Ko

AI总结:

本研究针对无锁二叉Trie实现难题,先构建基于读、写、CAS及$\log u$位AND运算的无等待松弛二叉Trie,再以此为组件实现无锁可线性化二叉Trie,给出各操作复杂度并分析实现难点。

摘要:

二叉Trie是一种用于全域$\u200b{0,\u2026,u-1}$上动态集合的串行数据结构,其Search(查找)操作的最坏情况步骤复杂度为$O(1)$,Insert(插入)、Delete(删除)和Predecessor(前驱)操作的最坏情况步骤复杂度为$O(\log u)$。\n 我们提出了一种松弛二叉Trie的无等待实现,使用读、写、CAS(比较并交换)以及$\log u$位的AND(与)运算。它支持所有操作,且最坏情况步骤复杂度与串行二叉Trie相同。不过,当存在并发更新操作时,Predecessor操作可能不会返回键值。我们将其作为组件,构建了一种无锁、可线性化的二叉Trie实现。该实现的Search操作最坏情况步骤复杂度为$O(1)$,Insert、Delete和Predecessor操作的摊销步骤复杂度为$O(c^2 + \log u)$,其中$c$是争用程度的度量。\n 与许多其他无锁数据结构相比,实现无锁二叉Trie更具挑战性,因为在最坏情况下,Insert和Delete操作需要对二叉Trie进行非常量次数的修改,才能保证Predecessor操作的正确性。

英文摘要:

A binary trie is a sequential data structure for a dynamic set on the universe $\{0,\dots,u-1\}$ supporting Search with $O(1)$ worst-case step complexity, and Insert, Delete, and Predecessor operations with $O(\log u)$ worst-case step complexity. We give a wait-free implementation of a relaxed binary trie, using read, write, CAS, and ($\log u$)-bit AND operations. It supports all operations with the same worst-case step complexity as the sequential binary trie. However, Predecessor operations may not return a key when there are concurrent update operations. We use this as a component of a lock-free, linearizable implementation of a binary trie. It supports Search with $O(1)$ worst-case step complexity and Insert, Delete and Predecessor with $O(c^2 + \log u)$ amortized step complexity, where $c$ is a measure of the contention. A lock-free binary trie is challenging to implement as compared to many other lock-free data structures because Insert and Delete operations perform a non-constant number of modifications to the binary trie in the worst-case to ensure the correctness of Predecessor operations.

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

↑