用HTM实现快速无锁树的模板
A Template for Implementing Fast Lock-free Trees Using HTM
摘要:
使用硬件事务内存(HTM)的算法必须提供一个仅限软件的回退路径来保证进度。回退路径的设计可能对性能产生深远的影响。如果允许回退路径与硬件事务并发运行,则必须对硬件事务进行检测,这会增加大量开销。否则,硬件事务必须等待回退路径上的任何进程,从而导致并发瓶颈,或者移动到回退路径。我们介绍了一种结合两种方法的方法。其关键思想是使用三条执行路径:HTM快速路径、HTM中间路径和软件回退路径,这样中间路径可以与其他两条路径同时运行。快速路径和回退路径不会并发运行,因此快速路径不会产生检测开销。此外,快速路径事务可以移动到中间路径,而不是等待或移动到软件路径。我们通过生成Brown等人的树更新模板的加速版本来演示我们的方法,其可用于实现基于下树的快速无锁数据结构。我们使用加速模板实现了两个无锁树:二叉搜索树(BST)和(a,b)树(B树的推广)。实验表明,与72个并发进程,我们的加速(a,b)树执行4.0倍和4.2倍之间的操作,每秒使用原始的树更新模板获得的实现。
英文摘要:
Algorithms that use hardware transactional memory (HTM) must provide a software-only fallback path to guarantee progress. The design of the fallback path can have a profound impact on performance. If the fallback path is allowed to run concurrently with hardware transactions, then hardware transactions must be instrumented, adding significant overhead. Otherwise, hardware transactions must wait for any processes on the fallback path, causing concurrency bottlenecks, or move to the fallback path. We introduce an approach that combines the best of both worlds. The key idea is to use three execution paths: an HTM fast path, an HTM middle path, and a software fallback path, such that the middle path can run concurrently with each of the other two. The fast path and fallback path do not run concurrently, so the fast path incurs no instrumentation overhead. Furthermore, fast path transactions can move to the middle path instead of waiting or moving to the software path. We demonstrate our approach by producing an accelerated version of the tree update template of Brown et al., which can be used to implement fast lock-free data structures based on down-trees. We used the accelerated template to implement two lock-free trees: a binary search tree (BST), and an (a,b)-tree (a generalization of a B-tree). Experiments show that, with 72 concurrent processes, our accelerated (a,b)-tree performs between 4.0x and 4.2x as many operations per second as an implementation obtained using the original tree update template.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。