逐桶并行数据库散列算法
Per-bucket concurrent rehashing algorithms
摘要:
本文描述了一种通用的算法,用于可扩展哈希表的并发重排序和按需逐桶重排序。与已知的基于锁的哈希表算法相比,所提出的算法分离了加密和解密阶段,使得它们既不会使现有桶无效,也不会阻止任何并发操作。相反,缓存工作被延迟,并在表的后续操作中拆分。缓存哈希操作仅使用存储桶级同步,因此允许在不同线程中运行的查找和移动操作之间存在争用条件。该算法不使用显式同步,而是检测竞争条件并重新启动查找操作。与其他基于锁的算法相比,该算法减少了热路径上的高级同步,提高了表的性能、并发性和可扩展性。操作的响应时间也更可预测。该算法与用于桶的高速缓存友好数据布局兼容,并且不依赖于任何存储器回收技术,因此通过相应的实现可能实现额外的性能增益。
英文摘要:
This paper describes a generic algorithm for concurrent resizing and on-demand per-bucket rehashing for an extensible hash table. In contrast to known lock-based hash table algorithms, the proposed algorithm separates the resizing and rehashing stages so that they neither invalidate existing buckets nor block any concurrent operations. Instead, the rehashing work is deferred and split across subsequent operations with the table. The rehashing operation uses bucket-level synchronization only and therefore allows a race condition between lookup and moving operations running in different threads. Instead of using explicit synchronization, the algorithm detects the race condition and restarts the lookup operation. In comparison with other lock-based algorithms, the proposed algorithm reduces high-level synchronization on the hot path, improving performance, concurrency, and scalability of the table. The response time of the operations is also more predictable. The algorithm is compatible with cache friendly data layouts for buckets and does not depend on any memory reclamation techniques thus potentially achieving additional performance gain with corresponding implementations.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。