C++ tbb 并发容器适用场景 concurrent_set concurrent_map concurrent_queue

Posted 软件工程小施同学

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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的主要内容,如果未能解决你的问题,请参考以下文章

C++ tbb unsafe_erase() 并发访问怎么办

TBB concurrent_unordered_map哪些操作可以并发

tbb 并发容器性能

C++ TBB concurrent_unordered_map find() at() return static_cast<size_t>( t ) * internal::hash_multip

TBB error Set TBB_PREVIEW_CONCURRENT_ORDERED_CONTAINERS to include concurrent_set.h

tbb::concurrent_hash_map 抛出 SIGSEGV