![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
tbb
文章平均质量分 70
Far5eer
这个作者很懒,什么都没留下…
展开
-
tbb学习笔记(一): tbb容器及Mutex
工作中用到过一些tbb,不过面试的时候别人一问就傻了,所以复习一下TBB的文档,并系统学习一下多线程编程。 1) TBB container tbb容器中用到的concurrency支持技术: • Fine-grainedlocking: Multiple threads operate on the container by locking only those portions the原创 2012-01-11 16:49:02 · 4027 阅读 · 0 评论 -
tbb学习笔记(二):原子操作
使用原子操作可以避免互斥。当一个线程调用原子操作时,其他线程会视之为瞬间发生的。 优点:相对于Lock速度快,且不会有死锁和convoying。 缺点:原子操作只限于有限的几种操作。 tbb中基本的原子操作如下表 所谓的compare_and_swap操作如下代码所示: atomic globalx; int UpdatedX() { // Update x and ret原创 2012-01-31 00:15:22 · 2362 阅读 · 0 评论