Concurrent data structures serve as fundamental building blocks for concurrent computing. Many concurrent counterparts have been designed for basic sequential mechanisms; however, one notable omission is a concurrent tree that supports aggregate queries. Aggregate queries essentially compile succinct information about a range of data items, for example, calculating the average salary of employees in their 30s. Such queries play an essential role in various applications and are commonly taught in undergraduate data structures courses. In this paper, we formalize a type of aggregate queries that can be efficiently supported by concurrent trees and present a design for implementing these queries on concurrent trees. We bring two algorithms implementing this design, where one optimizes for tree update time, while the other optimizes for aggregate query time. We analyze their correctness and complexity, demonstrating the trade-offs between query time and update time.
A Scalable Concurrent Algorithm for Dynamic Connectivity
动态连通性是一个基本的算法图问题,其动机是广泛应用于社交和通信网络,并用作各种其他算法的构建块,例如双连通性和动态最小生成树问题。简而言之,我们希望在动态边插入和删除下保持图的连通分量。在连续的情况下,这个问题已经从理论和实践两个角度得到了很好的研究。然而,更少的是知道有效的并发解决方案,这个问题。这就是我们在本文中要解决的问题。我们从用于解决这个问题的经典数据结构之一--Euler Tour Tree开始。我们的第一个贡献是一个非阻塞的单作家implementationofit. We利用这种数据结构,以获得第一个真正的并发泛化的动态连接,它保留了其顺序对应的时间复杂度,但在实践中也是可扩展的。为了实现这一点,我们主要依靠三种技术。第一个是确保连接查询(通常在现实世界的工作负载中占主导地位)是非阻塞的。第二个非平凡技术通过使所有不改变连接结构的查询成为非阻塞来扩展上述思想。第三个要素是应用细粒度锁定来更新连接的组件,这允许对不相交组件的操作并行发生。我们评估所产生的算法在各种工作负载,执行真实和合成图。结果显示了每个建议的优化的效率;最有效的变体提高了基于粗粒度的实现在实际场景中的性能,平均高达6倍,当连接查询占主导地位时高达30倍。