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
2,419 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
2,387 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-threading-building-blocks-developer-reference/task-scheduler/taskarena-class.html for details.


View solution in original post

0 Kudos
3 Replies
AbhishekD_Intel
Moderator
2,398 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


0 Kudos
James_T_Intel
Moderator
2,388 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-threading-building-blocks-developer-reference/task-scheduler/taskarena-class.html for details.


0 Kudos
James_T_Intel
Moderator
2,386 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.


0 Kudos
Reply