Skip to main content
QUICK REVIEW

[论文解读] Reuse, don't Recycle: Transforming Lock-free Algorithms that Throw Away Descriptors

Maya Arbel-Raviv, Trevor Brown|arXiv (Cornell University)|Aug 5, 2017
Parallel Computing and Optimization Techniques被引用 4
一句话总结

本文提出一种转换技术,将无锁算法中的描述符分配与回收替换为描述符复用,显著降低内存开销并提升性能。通过设计一种弱描述符抽象数据类型(ADT),并将其应用于 k-CAS 和 LLX/SCX 等算法,作者实现了峰值内存使用量降低高达 1,000 倍,并在不牺牲正确性或无锁进展的前提下获得显著的性能提升。

ABSTRACT

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.

研究动机与目标

  • 解决无锁算法中分配和回收描述符所导致的高空间与时间开销问题。
  • 消除对复杂无锁内存回收机制(如危险指针或 DEBRA+)的需求。
  • 在不损害正确性或进展保证的前提下,为一大类无锁算法实现高效的描述符复用。
  • 提供一种实用且通用的转换技术,适用于现实世界中的并发数据结构。
  • 提升依赖描述符的算法(如 k-CAS 和 LLX/SCX)的性能与内存效率。

提出的方法

  • 为无锁算法中的描述符使用引入一种抽象数据类型(ADT),区分不可变描述符与可变描述符。
  • 提出一种弱描述符 ADT,其语义宽松,允许在无需内存回收的情况下安全复用。
  • 设计一种转换框架,将现有抛出描述符的算法重写为每个进程使用两个可复用的描述符。
  • 通过证明弱描述符 ADT 在所有执行路径下均保持原始算法的语义,确保正确性。
  • 在 k-CAS 和 LLX/SCX 算法上实现该转换,将动态分配替换为描述符复用。
  • 通过严谨的实验评估不同工作负载下的性能与内存使用情况,与传统描述符回收方法进行对比。

实验结果

研究问题

  • RQ1描述符复用是否可以安全地应用于当前丢弃描述符的广泛无锁算法类别?
  • RQ2与传统回收技术相比,描述符复用在多大程度上能减少峰值内存使用量?
  • RQ3描述符复用是否能在 k-CAS 和 LLX/SCX 等并发数据结构中带来可测量的性能提升?
  • RQ4弱描述符 ADT 是否能消除对复杂内存回收机制的需求,同时不损害正确性?
  • RQ5转换后算法的性能在不同工作负载和线程数量下的可扩展性如何?

主要发现

  • 经转换的 k-CAS 算法相比次优实现,峰值内存使用量降低了近三个数量级。
  • 采用描述符复用的 k-CAS 算法在高竞争环境下相比描述符回收实现表现出显著的性能提升。
  • 采用描述符复用的 LLX/SCX 实现版本在更新操作频繁的工作负载中展现出显著性能优势,提升了底层二叉搜索树的效率。
  • 弱描述符 ADT 实现了安全且高效的描述符复用,无需复杂内存回收机制,从而消除了对危险指针或类似机制的需求。
  • 该转换具有通用性,适用于当前分配并回收描述符的广泛无锁算法类别。
  • 实验结果证实,描述符复用不仅降低了内存消耗,还加快了执行速度,即使在无硬件事务内存支持的系统上亦是如此。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。