views:

35

answers:

2

How does Intel TBB choose the number of threads to used for a parallel section?

Is there some kind of specification available?

A: 

Documetation says just "dependent on hardware configuration". Possibly it just number of CPU cores available.

blaze
A: 

When you create the scheduler, you can specify the number of threads as

  tbb::task_scheduler_init init(nthread);

else you can use

tbb::task_scheduler_init init(tbb::task_scheduler_init::automatic);

In this case, tbb scheduler creates as many threads as your CPU cores

Manny