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

tbb::task_scheduler_init class (newbie)

yesilgulalp
Novice
672 Views

Hi,

In the past, there was a class named "task_scheduler_init" in the "tbb" library, but I think that class does not exist anymore. For example, instead of the "tbb :: task_scheduler_init :: default_num_threads ()" function, there could be an approach like this link -> https://github.com/oneapi-src/oneTBB/issues/248
My question is how can I determine how many threads to use for execution. Specifically "tbb :: task_scheduler_init init {number};" What can I use instead?

0 Kudos
1 Solution
James_T_Intel
Moderator
640 Views

You will need to use task_arena and control the concurrency to achieve this effect. When you create a task_arena, you can specify the maximum concurrency, which will set how many threads are used. Please see https://software.intel.com/content/www/us/en/develop/documentation/tbb-documentation/top/intel-threa... for details.


View solution in original post

3 Replies
AbhishekD_Intel
Moderator
651 Views

Hi,

Thanks for reaching out to us.

As this issue is more related to TBB, we are moving this issue to the oneAPI TBB forum.


Warm Regards,

Abhishek


James_T_Intel
Moderator
641 Views

You will need to use task_arena and control the concurrency to achieve this effect. When you create a task_arena, you can specify the maximum concurrency, which will set how many threads are used. Please see https://software.intel.com/content/www/us/en/develop/documentation/tbb-documentation/top/intel-threa... for details.


James_T_Intel
Moderator
639 Views

This issue has been resolved and we will no longer monitor this thread. If you require additional assistance from Intel, please start a new thread.Any further interaction in this thread will be considered community only.


Reply