Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Robin_L_
Beginner
40 Views

Why I cannot create threads more than 32 by using tbb::task_scheduler_init?

I tried to use task_scheduler_init to control the number of threads in my program. However, it seem that no matter how many threads I set, the maximum number of threads is 32. For example, I set task_scheduler_init like this.

tbb::task_scheduler_init init(100);

In fact the number of threads is still 32.

I tried to use limited_arena to break the limitation, but failed.

0 Kudos
2 Replies
Alexei_K_Intel
Employee
40 Views

Hi,

I suppose your machine has 8 hardware threads and the current limitation of TBB for the maximum number of threads is "4 * number of hardware threads". Usually 4x oversubscription is enough for the majority of algorithms. Could you share details of your algorithm why do you need to oversubscribe the machine so much?

Regards, Alex

Robin_L_
Beginner
40 Views

Alexei K. (Intel) wrote:

Hi,

I suppose your machine has 8 hardware threads and the current limitation of TBB for the maximum number of threads is "4 * number of hardware threads". Usually 4x oversubscription is enough for the majority of algorithms. Could you share details of your algorithm why do you need to oversubscribe the machine so much?

Regards, Alex

Yes, Alex, I'm using i7 6700K and it has 8 logic cores. I'm doing the test of TSX now and I want to explore when the performance drop down dramatically. As a result, I need to inrease the thread pool as more as possible. I'm using a simple bank account parallel trasction as a test model. And I also used the parallel K-means to test RTM (but I didn't use too too many tbb libraries here.)

I tried to use the tbb::global_control to change the limitation but it seems totally inaccuracy and out of control.

Reply