Multi-thread applications commonly utilize condition variables for communication between threads. Condition variables allow threads to block and wait until a certain condition holds, and also enable threads to wake up their blocked peers notifying them about a change to the state of shared data. Quite often such notifications are delivered to all threads, while only a small number of specific threads is interested in it. This results in so-called futile wakeups, where threads receiving the notification wake up and resume their execution only to realize that the condition they are waiting for does not hold and they need to wait again. Those wakeups cause numerous context switches, increase lock contention and cache pressure, translating into lots of wasted computing cycles and energy. In this work, we propose to delegate conditions on which threads are waiting to the thread sending notifications. This enables the latter to evaluate the conditions and send the notification(s) only to the relevant thread(s), practically eliminating futile wakeups altogether. Our initial evaluation of this idea shows promising results, achieving 3-4x throughput improvement over legacy condition variables.


翻译:多线索应用程序通常使用条件变量进行线条之间的通信。 条件变量允许线条阻塞并等待特定条件的维持, 也允许线条唤醒被阻塞的同龄人, 通知共享数据状态的变化。 很多情况下, 这些通知被发送到所有线条上, 而只有一小部分特定的线条对此感兴趣。 这导致所谓的徒劳的唤醒, 接收通知的线条会醒来并恢复执行, 只意识到他们等待通知的条件无法维持, 需要再次等待。 这些觉醒会引发许多上下文开关, 增加锁定参数和缓存压力, 转化成大量浪费的计算周期和能量。 在这项工作中, 我们提议将线索等待发送通知的条件委托给所有线条。 这让后者能够评估条件, 并将通知发送到相关的线条上, 几乎完全消除徒劳的唤醒。 我们对这个想法的初步评估显示有希望的结果, 实现3-4x的负值改进了遗留条件变量。

0
下载
关闭预览

相关内容

Linux导论,Introduction to Linux,96页ppt
专知会员服务
76+阅读 · 2020年7月26日
因果图,Causal Graphs,52页ppt
专知会员服务
241+阅读 · 2020年4月19日
开源书:PyTorch深度学习起步
专知会员服务
50+阅读 · 2019年10月11日
强化学习最新教程,17页pdf
专知会员服务
171+阅读 · 2019年10月11日
机器学习入门的经验与建议
专知会员服务
91+阅读 · 2019年10月10日
最新BERT相关论文清单,BERT-related Papers
专知会员服务
52+阅读 · 2019年9月29日
计算机 | 入门级EI会议ICVRIS 2019诚邀稿件
Call4Papers
10+阅读 · 2019年6月24日
【TED】生命中的每一年的智慧
英语演讲视频每日一推
9+阅读 · 2019年1月29日
【TED】什么让我们生病
英语演讲视频每日一推
7+阅读 · 2019年1月23日
meta learning 17年:MAML SNAIL
CreateAMind
11+阅读 · 2019年1月2日
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
16+阅读 · 2018年12月24日
条件GAN重大改进!cGANs with Projection Discriminator
CreateAMind
8+阅读 · 2018年2月7日
计算机视觉近一年进展综述
机器学习研究会
8+阅读 · 2017年11月25日
【推荐】树莓派/OpenCV/dlib人脸定位/瞌睡检测
机器学习研究会
9+阅读 · 2017年10月24日
论文共读 | Attention is All You Need
黑龙江大学自然语言处理实验室
14+阅读 · 2017年9月7日
【学习】Hierarchical Softmax
机器学习研究会
4+阅读 · 2017年8月6日
Arxiv
0+阅读 · 2021年7月2日
Arxiv
9+阅读 · 2018年3月10日
VIP会员
相关VIP内容
Linux导论,Introduction to Linux,96页ppt
专知会员服务
76+阅读 · 2020年7月26日
因果图,Causal Graphs,52页ppt
专知会员服务
241+阅读 · 2020年4月19日
开源书:PyTorch深度学习起步
专知会员服务
50+阅读 · 2019年10月11日
强化学习最新教程,17页pdf
专知会员服务
171+阅读 · 2019年10月11日
机器学习入门的经验与建议
专知会员服务
91+阅读 · 2019年10月10日
最新BERT相关论文清单,BERT-related Papers
专知会员服务
52+阅读 · 2019年9月29日
相关资讯
计算机 | 入门级EI会议ICVRIS 2019诚邀稿件
Call4Papers
10+阅读 · 2019年6月24日
【TED】生命中的每一年的智慧
英语演讲视频每日一推
9+阅读 · 2019年1月29日
【TED】什么让我们生病
英语演讲视频每日一推
7+阅读 · 2019年1月23日
meta learning 17年:MAML SNAIL
CreateAMind
11+阅读 · 2019年1月2日
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
16+阅读 · 2018年12月24日
条件GAN重大改进!cGANs with Projection Discriminator
CreateAMind
8+阅读 · 2018年2月7日
计算机视觉近一年进展综述
机器学习研究会
8+阅读 · 2017年11月25日
【推荐】树莓派/OpenCV/dlib人脸定位/瞌睡检测
机器学习研究会
9+阅读 · 2017年10月24日
论文共读 | Attention is All You Need
黑龙江大学自然语言处理实验室
14+阅读 · 2017年9月7日
【学习】Hierarchical Softmax
机器学习研究会
4+阅读 · 2017年8月6日
Top
微信扫码咨询专知VIP会员