本文主要是介绍C++ tbb 并发容器适用场景 concurrent_set concurrent_map concurrent_queue,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
比如
tbb::concurrent_set
is a class template that represents an unordered sequence of unique elements. It supports concurrent insertion, lookup and traversal, but does not support concurrent erasure.
适用于:
(插入、查找)阶段和删除阶段如果独立,则不用加锁
如果不独立,则都要加锁,插入、查找加读锁,删除加写锁
concurrent_set — oneAPI Specification 1.0-rev-3 documentation
这篇关于C++ tbb 并发容器适用场景 concurrent_set concurrent_map concurrent_queue的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!