Intel® Threading Building Blocks (Intel® TBB) 2.2 and later automatically initializes the task scheduler. You can use class task_scheduler_init to explicitly initialize the task scheduler, which can be useful for doing any of the following:
Control when the task scheduler is constructed and destroyed.
Specify the number of threads used by the task scheduler.
Specify the stack size for worker threads.
The high-level loop and pipeline templates in Intel® Threading Building Blocks give you efficient scalable ways to exploit the power of multi-core chips without having to start from scratch. They let you design your software at a high task-pattern level and not worry about low-level manipulation of threads. Because they are generic, you can customize them to your specific needs. Have fun using these templates to unlock the power of multi-core.
It is possible to upgrade a reader lock to a writer lock, by using the method upgrade_to_writer. Here is an example.
This section explains programming techniques for making best use of the scheduler.
Choose the next work item to do, based on priorities.
The scheduler in Intel® Threading Building Blocks (Intel® TBB) chooses tasks using rules based on scalability concerns. The rules are based on the order in which tasks were spawned or enqueued, and are oblivious to the contents of tasks. However, sometimes it is best to choose work based on some kind of priority relationship.
This section describes features of Intel® Thread Building Blocks (Intel® TBB) that relate to general environment issues.
Specify that a parallel loop should recursively split its range until it cannot be subdivided further.
SummaryTemplate function that evaluates several functions in parallel.
template<typename Func0, typename Func1> void parallel_invoke(const Func0& f0, const Func1& f1); template<typename Func0, typename Func1, typename Func2>
- Page 1