Control the number threads
- Method 1: Use the environment variable
TBB_NUM_THREADS
for the gloabl setting.
1 | export TBB_NUM_THREADS=4 |
TODO: It doesn’t seem to work!
- Method 2: Use
tbb::task_arena
ortbb::task_scheduler_init
(Deprecated).
TBB will use this setting locally within the scope of the tbb::task_arena
.
1 |
|