Intel® oneAPI Threading Building Blocks
Ask questions and share information about adding parallelism to your applications when using this threading library.

task_scheduler_init creation and release

hedgehogest
Beginner
110 Views

Hi, guys,

The description of TBB task_scheduler_init is

Detailed Description

Class representing reference to tbb scheduler.

A thread must construct a task_scheduler_init, and keep it alive, during the time that it uses the services of class task.


I am not sure the meaning of the word A thread . Does this mean main thread or the the thread where new task is created.

Could I only create task_scheduler_init only once. Or every thread when new task is going to be created?

Thanks.


0 Kudos
3 Replies
RafSchietekat
Black Belt
110 Views
"Using task_scheduler_init is optional [since] Intel TBB 2.2."
hedgehogest
Beginner
110 Views
Thanks. Since I am using 3.0, so there is no need to use task_scheduler_init when creating task ,and no performance impact, right?
RafSchietekat
Black Belt
110 Views
Normally you needn't worry about it, and rarely will it be what you'll look at to improve performance.
Reply