Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Shayan_Y_
Beginner
17 Views

Get number of task

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
17 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