Intel® oneAPI Threading Building Blocks
Ask questions and share information about adding parallelism to your applications when using this threading library.
Announcements
This community is designed for sharing of public information. Please do not share Intel or third-party confidential information here.

TBB spawns more threads than requested

Stephan_E_
Beginner
101 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
Black Belt
101 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."

Reply