- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have read TBB reference but I still have no clue how to use TBB in C++11 compiler properly.
In my C++11 compatible compiler,
1. Should I use std::thread or include tbb own std thread class?
2. Can I mix compiler built-in threading library with tbb? Eg, Can std::mutex work in tbb::parallel_for?
I found a forum thread in 2012 but I can't figure it out the conclusion. Can anyone provide a guide line? For sure, I can write a test case to give it a try. But I'd like to hear it from tbb developers.
TIA
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Ricky,
Historically, Intel TBB had introduced many C++11-like features before the C++11 language was developed. There has never be a goal to implement the standard features within tbb-namespace, so such stuff as tbb::atomic, tbb::mutex and other seem obsolete. Therefore, if you need a functionality that is implemented in C++, I recommend using it instead of Intel TBB.
As for your questions:
1. Should I use std::thread or include tbb own std thread class?
Feel free to use std::thread.
2. Can I mix compiler built-in threading library with tbb? Eg, Can std::mutex work in tbb::parallel_for?
All C++11 synchronization primitives will work within Intel TBB parallel constructions. There are some differences in interfaces that are described in the C++11 Synchronization section. In addition, you can mix Intel TBB threading with any other threading. See the Appendix B Mixing With Other Threading Packages section.
Regards, Alex
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Ricky,
Historically, Intel TBB had introduced many C++11-like features before the C++11 language was developed. There has never be a goal to implement the standard features within tbb-namespace, so such stuff as tbb::atomic, tbb::mutex and other seem obsolete. Therefore, if you need a functionality that is implemented in C++, I recommend using it instead of Intel TBB.
As for your questions:
1. Should I use std::thread or include tbb own std thread class?
Feel free to use std::thread.
2. Can I mix compiler built-in threading library with tbb? Eg, Can std::mutex work in tbb::parallel_for?
All C++11 synchronization primitives will work within Intel TBB parallel constructions. There are some differences in interfaces that are described in the C++11 Synchronization section. In addition, you can mix Intel TBB threading with any other threading. See the Appendix B Mixing With Other Threading Packages section.
Regards, Alex

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page