大原子操作(Big Atomics)
Big Atomics
AI总结:
针对现有硬件仅支持小宽度原子操作的局限,提出基于快路径-慢路径的任意k字无锁Big Atomics实现,实验验证其性能优异,且基于其构建的并发哈希表性能优于多种前沿方案。
摘要:
本文提出了Big Atomics(即支持加载、存储与比较并交换(CAS)操作的k字线性化寄存器)在理论和实践层面均高效的实现方案。现代硬件仅支持k=1的场景,部分情况下支持k=2(例如x86架构中的双宽度比较并交换),而我们的实现支持任意k值。Big Atomics可应用于元组原子操作、版本列表管理以及加载链接/存储条件(LL/SC)实现等诸多场景。我们基于提出的新型快路径-慢路径方法,设计了快速的无锁Big Atomics实现,随后利用该实现构建了高效的并发哈希表,以验证其实用价值。\n我们通过在多种工作负载(线程数、加载/存储比例、竞争程度、资源超额订阅程度以及原子操作数量)下对比多种Big Atomics实现方案,对该方法进行了实验验证。实验将我们提出的两种无锁变体与C++ std::atomic、基于锁的实现、序列锁实现以及间接实现进行了对比。结果表明,我们的方法在所有场景下性能均接近最优方案,且在资源超额订阅场景下性能远超其他方案。我们还将基于Big Atomics构建的并发哈希表与多种支持任意长度键值对的前沿哈希表进行了对比,包括英特尔TBB、Facebook Folly、libcuckoo以及Boost最新版本中的实现。结果显示,将Big Atomics应用于哈希表设计是一个极具前景的研究方向。
英文摘要:
In this paper, we give theoretically and practically efficient implementations of Big Atomics, i.e., $k$-word linearizable registers that support the load, store, and compare-and-swap (CAS) operations. While modern hardware supports $k = 1$ and sometimes $k = 2$ (e.g., double-width compare-and-swap in x86), our implementations support arbitrary $k$. Big Atomics are useful in many applications, including atomic manipulation of tuples, version lists, and implementing load-linked/store-conditional (LL/SC). We design fast, lock-free implementations of big atomics based on a novel fast-path-slow-path approach we develop. We then use them to develop an efficient concurrent hash table, as evidence of their utility. We experimentally validate the approach by comparing a variety of implementations of big atomics under a variety of workloads (thread counts, load/store ratios, contention, oversubscription, and number of atomics). The experiments compare two of our lock-free variants with C++ std::atomic, a lock-based version, a version using sequence locks, and an indirect version. The results show that our approach is close to the fastest under all conditions and far outperforms others under oversubscription. We also compare our big atomics based concurrent hash table to a variety of other state-of-the-art hash tables that support arbitrary length keys and values, including implementations from Intel's TBB, Facebook's Folly, libcuckoo, and a recent release from Boost. The results show that our approach of using big atomics in the design of hash tables is a promising direction.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。