为什么Intel TBB不提供boost这样的条件变量?
就像条件信号机制一样,我希望一个任务等待,直到收到某个信号或某个变量变为真。 Boost lib提供了这种机制,但TBB没有。
这个案例在TBB中如何实现?
Like conditional signal mechanism, I want one task to wait until some signal is received or some variable becomes true.
Boost lib provide this mechanism, but TBB didn't.
How to implement this case in TBB?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您使用的是非常旧的 TBB 吗?
让任务“等待”是 TBB 过去处理不好的问题,但当前的 TBB 新闻 包含这:
即他们承认 TBB 的任务并行性不是万能的灵丹妙药,有时您需要更像“传统”线程模型的 I/O。事实上,如果您查看最新的参考手册你会发现 TBB 现在包含条件变量! (参见第 8.4 节)
Are you using a very old TBB ?
Having tasks "wait" is something TBB hasn't handled well in the past, but the current TBB news contains this:
ie they're admitting TBB's task parallelism isn't a universal panacea and you need something more like the "traditional" threading model sometimes for I/O. And indeed if you check the latest reference manual you'll find TBB does now contain condition variables! (See section 8.4)