重用,不要回收:转换抛弃描述符的无锁算法
Reuse, don't Recycle: Transforming Lock-free Algorithms that Throw Away Descriptors
摘要:
在许多无锁算法中,线程互相帮助,每个操作都创建一个描述符来描述其他线程应该如何帮助它。分配和回收描述符会引入大量的空间和时间开销。我们引入了第一个描述符抽象数据类型(ADT),它通过无锁算法捕获描述符的使用。然后,我们开发了一个弱描述符ADT具有较弱的语义,但可以更有效地实现。我们展示了如何将一大类无锁算法转换为使用弱描述符,并通过转换几种算法(包括领先的k-比较和交换(k-CAS)算法)来演示我们的技术。原始k-CAS算法为每个k-CAS分配至少k+1个新描述符。相比之下,我们的实现为每个进程分配了两个描述符,每个进程只是重用它的两个描述符。在各种工作负载上的实验表明,回收描述符的实现显着的性能改进,并减少高达三个数量级的峰值内存使用。
英文摘要:
In many lock-free algorithms, threads help one another, and each operation creates a descriptor that describes how other threads should help it. Allocating and reclaiming descriptors introduces significant space and time overhead. We introduce the first descriptor abstract data type (ADT), which captures the usage of descriptors by lock-free algorithms. We then develop a weak descriptor ADT which has weaker semantics, but can be implemented significantly more efficiently. We show how a large class of lock-free algorithms can be transformed to use weak descriptors, and demonstrate our technique by transforming several algorithms, including the leading k-compare-and-swap (k-CAS) algorithm. The original k-CAS algorithm allocates at least k+1 new descriptors per k-CAS. In contrast, our implementation allocates two descriptors per process, and each process simply reuses its two descriptors. Experiments on a variety of workloads show significant performance improvements over implementations that reclaim descriptors, and reductions of up to three orders of magnitude in peak memory usage.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。