知识卡片
动态分工缓解任务失衡
优化CPU除改进热点算法,还要避免某些工作线程忙而其他线程空闲。任务难度事先未知时,可用共享工作队列让空闲线程继续领取任务,或用工作窃取从邻近线程借工作。拆分过细会带来同步和共享状态成本,仍受Amdahl与USL限制,不能把均匀线程数当均匀工作量。
相关:[[串行部分限制并行收益]]。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 理解性能的心智模型 · 查看原书依据
In those cases, we have to either delay the work assignments or readjust them while the program is running. We usually handle this issue with a shared job queue from which threads take work after finishing the current task or using work stealing. With work stealing, idling threads borrow work from neighboring threads.
参考来源
- 位置:《Software Architecture and Decision-Making》第3章《理解性能的心智模型》(来源项目:book-sources;源文件:extracted/Software Architecture and Decision-Making Leveraging Leadership, Technology, and Product Management to Build Great Products… (Srinath Perera)/_epub-src/ch03.xhtml)
- 结论依据:原文的定义、比较或例子支持“优化CPU除改进热点算法,还要避免某些工作线程忙而其他线程空闲”;正文据此说明用途和边界。
- 原始内容:In those cases, we have to either delay the work assignments or readjust them while the program is running. We usually handle this issue with a shared job queue from which threads take work after finishing the current task or using work stealing. With work stealing, idling threads borrow work from neighboring threads.