[论文解读] A Lock-Free Work-Stealing Algorithm for Bulk Operations
本文提出 LF_Queue,为主–工 DD-BD 求解器提供一个无锁、无界、对批量友好的工作窃取队列,并证明在无锁情况下实现常量延迟的批量推送和可扩展的批量窃取。
Work-stealing is a widely used technique for balancing irregular parallel workloads, and most modern runtime systems adopt lock-free work-stealing deques to reduce contention and improve scalability. However, existing algorithms are designed for general-purpose parallel runtimes and often incur overheads that are unnecessary in specialized settings. In this paper, we present a new lock-free work-stealing queue tailored for a master-worker framework used in the parallelization of a mixed-integer programming optimization solver based on decision diagrams. Our design supports native bulk operations, grows without bounds, and assumes at most one owner and one concurrent stealer, thereby eliminating the need for heavy synchronization. We provide an informal sketch that our queue is linearizable and lock-free under this restricted concurrency model. Benchmarks demonstrate that our implementation achieves constant-latency push performance, remaining stable even as batch size increases, in contrast to existing queues from C++ Taskflow whose latencies grow sharply with batch size. Pop operations perform comparably across all implementations, while our steal operation maintains nearly flat latency across different steal proportions. We also explore an optimized steal variant that reduces latency by up to 3x in practice. Finally, a pseudo workload based on large-graph exploration confirms that all implementations scale linearly. However, we argue that solver workloads with irregular node processing times would further amplify the advantages of our algorithm.
研究动机与目标
- 为在主–工设定下的基于并行决策图的混合整数规划任务提供动机。
- 设计一个无锁队列,支持原生批量推送/窃取、无界增长,且最多只有两位并发用户(拥有者与单一窃取者)。
- 给出正确性要点(线性化与无锁进度)并在与现有 Taskflow 队列的性能对比中进行评估。
- 通过基准测试证明批量操作具有恒定或几乎恒定的延迟,并且方法能够随工作量规模线性扩展。
提出的方法
- 提出一个用单向链表实现的双端队列,具有原子大小和头指针,以及填充以避免伪共享。
- 提供 API 操作:push(批量)、pop(拥有者)、steal(从尾部的批量窃取),并给出特定的内存序语义(放松、获取–释放)。
- 窃取计算一个截断点,以从尾部窃取一定比例的节点,并进行一致性检查以在快速消耗时中止。
- 通过将窃取截断点识别为线性化点并展示内部链接仅由拥有者重写来论证线性化性。
- 提供一个优化,在拥有者在窃取期间未更新队列时跳过完整遍历,从而降低窃取延迟。
- 在两个 Taskflow 队列(Unbounded 与 Bounded)上对推送/窃取延迟进行对比,并使用伪 DAG 工作负载评估可扩展性。
实验结果
研究问题
- RQ1LF_Queue 设计在主–工设置下是否提供无锁进度,且仅存在一个窃取者?
- RQ2随着批量大小增大,批量推送和批量窃取是否仍保持低延迟和可扩展性?
- RQ3在批量操作和不同窃取比例下,LF_Queue 的性能与现有 Taskflow 队列相比如何?
- RQ4该方法在现实并行工作负载如 DAG 探索(节点处理时间不规则)上是否具备可扩展性?
主要发现
- LF_Queue 在批量推送操作对批量大小(1–1024 节点)保持近似恒定的延迟,并在批量大小增加时优于 Taskflow 队列。
- 在 LF_Queue 中,窃取延迟随窃取比例几乎保持平坦,而 Taskflow 队列在窃取增多时呈线性增长。
- 一种优化的窃取变体在拥有者在窃取期间未更新时可将延迟在常见情况下减少最多 3 倍。
- 在基于 DAG 的伪工作负载中,该方案展现出接近对数线性规模性,显示出良好的并行效率。
- 该方法支持无界增长且无需重新调整大小,在受限并发模型(拥有者+单一窃取者)下保持线性化。
- 基准测试显示推送具有恒定延迟且窃取稳定,弹出(pop)操作在不同实现之间仍然可比。
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。