Intel® oneAPI Threading Building Blocks Developer Guide and API Reference
ID
772616
Date
3/31/2025
Public
A newer version of this document is available. Customers should click here to go to the newest version.
Package Contents
Parallelizing Simple Loops
Parallelizing Complex Loops
Parallelizing Data Flow and Dependence Graphs
Work Isolation
Exceptions and Cancellation
Containers
Mutual Exclusion
Timing
Memory Allocation
The Task Scheduler
Design Patterns
Migrating from Threading Building Blocks (TBB)
Constrained APIs
Appendix A Costs of Time Slicing
Appendix B Mixing With Other Threading Packages
References
parallel_for_each Body semantics and requirements
parallel_sort ranges interface extension
TBB_malloc_replacement_log Function
Parallel Reduction for rvalues
Type-specified message keys for join_node
Scalable Memory Pools
Helper Functions for Expressing Graphs
concurrent_lru_cache
task_group extensions
Description
API
The customizing mutex type for concurrent_hash_map
Waiting for Single Messages in Flow Graph
parallel_phase Interface for Task Arena
Deduction Guides for blocked_nd_range
task_group extensions
NOTE:
To enable these extensions, set the TBB_PREVIEW_TASK_GROUP_EXTENSIONS macro to 1.
Description
Intel® oneAPI Threading Building Blocks (oneTBB) implementation extends the tbb::task_group specification with the requirements for a user-provided function object.
API
Header
#include <oneapi/tbb/task_group.h>
Synopsis
namespace oneapi {
namespace tbb {
class task_group {
public:
//only the requirements for the return type of function F are changed
template<typename F>
task_handle defer(F&& f);
//only the requirements for the return type of function F are changed
template<typename F>
task_group_status run_and_wait(const F& f);
//only the requirements for the return type of function F are changed
template<typename F>
void run(F&& f);
};
} // namespace tbb
} // namespace oneapi
Member Functions
template<typenameF>
task_handledefer(F&&f)
As an optimization hint, F might return a task_handle, which task object can be executed next.
NOTE:
The task_handle returned by the function must be created using *thistask_group. That is, the one for which the run method is called, otherwise it is undefined behavior.
template<typenameF>
task_group_statusrun_and_wait(constF&f)
As an optimization hint, F might return a task_handle, which task object can be executed next.
NOTE:
The task_handle returned by the function must be created using *thistask_group. That is, the one for which the run method is called, otherwise it is undefined behavior.
template<typenameF>
voidrun(F&&f)
As an optimization hint, F might return a task_handle, which task object can be executed next.
NOTE:
The task_handle returned by the function must be created with *thistask_group. It means, with the one for which run method is called, otherwise it is an undefined behavior.
See also