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

TBB spawns more threads than requested

Stephan_E_
Beginner
278 Views

Hi all,

I am implementing and tuning an algorithm and need to specify for the exact number of threads to use. I can observe that no more threads than specified are active at a time, however the scheduler seems to sometimes spawn new threads. Old theads then become idle.

Can anyone please elaborate why the scheduler thinks this is worthwhile?

Thanks and Best Regards!

0 Kudos
1 Reply
RafSchietekat
Valued Contributor III
278 Views

In "Bug with tbb::task_scheduler_init()?", Alexey Kukanov refers to a note in the Reference Manual for task_scheduler_init that, in the latest PDF version I have, reads: "Some implementations create more workers than necessary. However, the excess workers remain asleep unless needed."

0 Kudos
Reply