Skip to Main Content
Intel Threading Building Blocks
book

Intel Threading Building Blocks

by James Reinders
July 2007
Intermediate to advanced content levelIntermediate to advanced
332 pages
10h 4m
English
O'Reilly Media, Inc.
Content preview from Intel Threading Building Blocks

Do Not Ship Your Program Built with TBB_DO_ASSERT

TBB_DO_ASSERT not only adds assertion checking, it also turns off some inlining and enables extra hidden fields in some data structures. Therefore, it slows down performance. Furthermore, code compiled with TBB_DO_ASSERT is typically linked against the debug version of the library, which has some significantly slow assertion checks.

TBB_DO_ASSERT writes out failures to stderr; there is no way to request it to throw exceptions. The errors it detects are so egregious that they should be eliminated during debugging and are not the sort we expect anyone to plan to handle in production code.

On Windows, the debug version is linked against Microsoft’s debug library, another reason it is unsuitable for production use. It is possible to use TBB_DO_ASSERT=1 and link against the release version of the Threading Building Blocks library, which gets you a few assertion checks. Still, we recommend setting TBB_DO_ASSERT=1 for development and debugging but having TBB_DO_ASSERT=0 for production code.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Intel® Xeon Phi™ Coprocessor Architecture and Tools: The Guide for Application Developers

Intel® Xeon Phi™ Coprocessor Architecture and Tools: The Guide for Application Developers

Rezaur Rahman

Publisher Resources

ISBN: 9780596514808Errata Page