The LevelArray:一种快速实用的长寿命重命名算法
The LevelArray: A Fast, Practical Long-Lived Renaming Algorithm
摘要:
长期存在的重命名问题出现在共享内存系统中,其中一组线程需要频繁地从计算中注册和注销,而并发操作扫描当前注册的线程集。这个问题的解决在事务内存、平面组合、线程屏障和无锁数据结构的内存回收方案的并发实现中出现。在本文中,我们分析了一个长寿命的重命名的随机解决方案。我们考虑的算法技术称为LevelArray,以前曾用于散列和一次性(一次性)重命名。我们的主要贡献是证明,在长寿命的执行,其中进程可以注册和注销多项式多次,该技术保证常数步骤平均和O(log log n)步骤的高概率注册,注销的单位成本,和O(n)步骤收集查询,其中n是一个上限的进程数,可能是活跃的在任何时间点。我们还表明,该算法具有令人惊讶的属性,它是自我修复:在合理的假设下的时间表,操作运行,而数据结构是在一个降级的状态隐含地帮助数据结构重新平衡本身。这种微妙的机制避免了昂贵的周期性重建过程的需要。我们的基准测试验证了这种方法,表明对于典型的使用参数,进程注册所需的平均步骤数小于2,最坏情况下的步骤数为6,即使在执行数十亿次操作时也是如此。我们将其与其他随机实现进行对比,我们证明其最坏情况下的行为是不可靠的,并且与确定性实现进行对比,其成本在n中是线性的。
英文摘要:
The long-lived renaming problem appears in shared-memory systems where a set of threads need to register and deregister frequently from the computation, while concurrent operations scan the set of currently registered threads. Instances of this problem show up in concurrent implementations of transactional memory, flat combining, thread barriers, and memory reclamation schemes for lock-free data structures. In this paper, we analyze a randomized solution for long-lived renaming. The algorithmic technique we consider, called the LevelArray, has previously been used for hashing and one-shot (single-use) renaming. Our main contribu- tion is to prove that, in long-lived executions, where processes may register and deregister polynomially many times, the technique guarantees constant steps on average and O(log log n) steps with high probability for registering, unit cost for deregistering, and O(n) steps for collect queries, where n is an upper bound on the number of processes that may be active at any point in time. We also show that the algorithm has the surprising property that it is self-healing: under reasonable assumptions on the schedule, operations running while the data structure is in a degraded state implicitly help the data structure re-balance itself. This subtle mechanism obviates the need for expensive periodic rebuilding procedures. Our benchmarks validate this approach, showing that, for typical use parameters, the average number of steps a process takes to register is less than two and the worst-case number of steps is bounded by six, even in executions with billions of operations. We contrast this with other randomized implementations, whose worst-case behavior we show to be unreliable, and with deterministic implementations, whose cost is linear in n.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。