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

支持渐近高效范围查询的无等待树

Wait-free Trees with Asymptotically-Efficient Range Queries

Ilya Kokorin, Dan Alistarh, Vitaly Aksenov

AI总结:

针对现有并发树不支持高效聚合范围查询的问题,提出基于交递帮助的无等待元数据维护机制,实现兼具渐近效率与可扩展性的无等待平衡二叉搜索树,实验验证了其加速效果。

摘要:

树数据结构(如红黑树、四叉树、树堆、前缀树)是计算机科学的基础工具。并发领域的经典问题是实现兼具表达力、高效性与可扩展性的实用树数据结构。我们关注支持范围查询的并发树,即涉及多个连续数据项的查询。现有具备该能力的实现可列出特定范围内的键,但不支持聚合范围查询:例如,若要计算某范围内的键数量,只能获取完整列表后返回其长度。这种方式并非最优:在串行场景下,可通过为平衡搜索树增设计数器,以对数时间而非线性时间完成这类聚合请求。\n 本文提出一种通用方法,可在并发树上实现广泛类别的范围查询,兼具无等待、渐近高效与实际可扩展性。核心思路是一种在树节点上并发维护元数据的新机制,可视为无等待版本的交递锁(我们称之为交递帮助)。我们实现、测试并基准测试了一棵支持无等待插入、删除、存在性查询与计数操作的平衡二叉搜索树,其中计数操作返回给定范围内的键数量,实验验证了我们的方法在实际应用中可带来预期的加速效果。

英文摘要:

Tree data structures, such as red-black trees, quad trees, treaps, or tries, are fundamental tools in computer science. A classical problem in concurrency is to obtain expressive, efficient, and scalable versions of practical tree data structures. We are interested in concurrent trees supporting range queries, i.e., queries that involve multiple consecutive data items. Existing implementations with this capability can list keys in a specific range, but do not support aggregate range queries: for instance, if we want to calculate the number of keys in a range, the only choice is to retrieve a whole list and return its size. This is suboptimal: in the sequential setting, one can augment a balanced search tree with counters and, consequently, perform these aggregate requests in logarithmic rather than linear time. In this paper, we propose a generic approach to implement a broad class of range queries on concurrent trees in a way that is wait-free, asymptotically efficient, and practically scalable. The key idea is a new mechanism for maintaining metadata concurrently at tree nodes, which can be seen as a wait-free variant of hand-over-hand locking (which we call hand-over-hand helping). We implement, test, and benchmark a balanced binary search tree with wait-free insert, delete, contains, and count operations, returning the number of keys in a given range which validates the expected speedups because of our method in practice.

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

↑