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

Get number of task

Shayan_Y_
Beginner
95 Views

In OpenMp we have omp_get_num_threads() that return the number of the available threads on the system. Do we have any function or class property in TBB that tell us the similar number(number of available tasks or available threads)?

I know in TBB we have tasks instead of thread, but I need to find out how many tasks(threads) available for the sake of my research whenever I initialize task scheduler automatically.

0 Kudos
1 Reply
RafSchietekat
Black Belt
95 Views

By default, the scheduler uses tbb::task_scheduler_init::default_max_threads() threads. The number of tasks is unlimited.

You can easily find this information in the User Guide and the Reference Manual.

Reply