开发者

TBB concurrent_vector with openmp

开发者 https://www.devze.com 2023-04-11 14:28 出处:网络
Can we use TBB concurrent_vector with开发者_开发知识库 openmp? Will concurrent updates be allowed?Yes, TBB\'s concurrent data structures are meant to be thread-safe, which means whatever threading pa

Can we use TBB concurrent_vector with开发者_开发知识库 openmp?

Will concurrent updates be allowed?


Yes, TBB's concurrent data structures are meant to be thread-safe, which means whatever threading paradigms, such as OpenMP, TBB, Cilk, PPL, and etc, are okay to use TBB's concurrent data structures. This is because concurrent_vector is simply a data structure class rather than threading-related control code.

Furthermore, TBB's mutex can be also used within OpenMP, Cilk, and PPL.


Per Section 1.11 of the concurrent_vector page on the Intel site, incremental growth, limited growth, and pushing of new objects onto the vector are all thread-safe operations.

The introduction also says that adding new elements does not invalidate existing iterators.

All these combined mean that you should be able to safely multithread access to the concurrent_vector with openmp.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号