tbb::atomic和std::atomic的区别 废弃
Posted 软件工程小施同学
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了tbb::atomic和std::atomic的区别 废弃相关的知识,希望对你有一定的参考价值。
tbb::atomic已经被废弃,可以使用std::atomic替代
https://www.intel.com/content/dam/develop/external/us/en/documents/tbbrevamp.pdf
tbb::atomic
class (as well as multiple obsolete and compatibility features) was deprecated in TBB 2019 U9 (for more information see TBB Revamp topic). All of these features were removed in oneTBB 2021.
Consider using std::atomic
as a replacement for tbb::atomic
.
tbb::atomic
was introduced when C++11 atomics were not invented yet. However, with C++11 tbb::atomic
became obsolete and did not bring any value. Overall, C++11 atomics can be more efficient than tbb::atomic
because they are recognizable by modern compilers and some additional optimization might take place.
以上是关于tbb::atomic和std::atomic的区别 废弃的主要内容,如果未能解决你的问题,请参考以下文章
C++ tbb::atomic<bool> 声明读取重新赋值