Linear probing is one of the simplest and most space-efficient approaches to hash table design, and is widely used in sequential settings due to its compact memory layout. However, designing a concurrent linear-probing hash table with strong liveness guarantees has proved difficult, and only a handful of such algorithms have been proposed, all of which either restrict concurrency or rely on large per-entry metadata, thereby compromising space efficiency. We present a lock-free linear-probing hash table with wait-free lookups that retains the core advantages of sequential linear probing while handling contention gracefully. Our design uses only a small amount of metadata per table entry: a constant number of additional bits when using LL/SC, or a logarithmic number of bits when using CAS. The algorithm is linearizable and lock-free, supports insert, delete, and wait-free lookup operations, and is able to safely reclaim space used by deleted elements without rebuilding the table. We analyze the amortized step complexity of our hash table assuming no concurrent insertions of the same key, and show that each operation has expected amortized step complexity matching that of sequential linear probing, up to the point contention per key.
翻译:线性探测是哈希表设计中最简单且空间效率最高的方法之一,因其紧凑的内存布局而广泛应用于串行场景。然而,设计具有强活性保证的并发线性探测哈希表一直颇具挑战,目前仅有少量此类算法被提出,它们要么限制并发性,要么依赖每个条目的大量元数据,从而牺牲了空间效率。我们提出了一种免锁线性探测哈希表,支持无等待查找操作,既保留了串行线性探测的核心优势,又能优雅地处理竞争。该设计每个表条目仅需少量元数据:使用LL/SC时需常数比特位,使用CAS时仅需对数级比特位。该算法可线性化且无锁,支持插入、删除及无等待查找操作,并能在不重建哈希表的情况下安全回收已删除元素所占用的空间。我们分析了假设无同一键并发插入情况下哈希表的均摊步骤复杂度,并证明在键级竞争限制下,每次操作的预期均摊步骤复杂度与串行线性探测相匹配。