知识卡片

普通读书笔记卡 · 2313.e.5.q.4.b.2.a

空闲工作者窃取积压

理解等级:高级

任务耗时不均会让某些队列积压而其他工作者空闲。工作窃取让空闲者从别的队列取得工作,降低最慢队列对整体完成的拖累。取队尾可减少与原执行者争抢,但真正避免同项被多取仍需要队列提供原子认领;不能从“取队尾”本身推出并发安全。

这张卡片看不懂?

已有反馈 · 0 / 10 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    参考来源

    - 位置:《Designing Distributed Systems, 2nd Edition》第12章《Chapter 12. Event-Driven Batch Processing》(来源项目 book-sources;源文件:extracted/Designing Distributed Systems, 2nd Edition/_epub-src/OEBPS/ch12.html) - 结论依据:原文用慢收银队列说明窃取;限定安全取出依赖底层操作。 - 原始内容:When there is no work on a worker’s queue, instead of sleeping until more work arrives, the worker takes work off of the back of the longest queue of any other worker. In this way, the maximum length of any work queue is kept to a minimum since