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

Thread Group

jaredkeithwhite
New Contributor I
1,016 Views
Has anyone worked on a thread group concept for TBB? I know that Boost has a thread group, and they aren't that difficult to implement. Has anyone else implemented one for TBB?


0 Kudos
6 Replies
Anton_Pegushin
New Contributor II
1,016 Views
Quoting - jaredkeithwhite
Has anyone worked on a thread group concept for TBB? I know that Boost has a thread group, and they aren't that difficult to implement. Has anyone else implemented one for TBB?


Hi, I think in terms of TBB that would be task_group... Meaning an interface that wraps parallel execution of functions inside tasks. Is that what you'd be interested in seeing in TBB?
0 Kudos
jaredkeithwhite
New Contributor I
1,016 Views
What I really want is just a counterparty to boost's thread_group, which allows me to join_all().

There are a couple of instances where I can't use the task concept (namely, when receiving asynchronous IO), and I would like to be able to spawn a few threads and join to them all from my main application thread.



Quoting - Anton Pegushin (Intel)
Hi, I think in terms of TBB that would be task_group... Meaning an interface that wraps parallel execution of functions inside tasks. Is that what you'd be interested in seeing in TBB?



0 Kudos
pvonkaenel
New Contributor III
1,016 Views
Quoting - jaredkeithwhite




I have not used it myself, but will it looks like the tbb_thread class has a join method.

Peter
0 Kudos
jaredkeithwhite
New Contributor I
1,016 Views
It does indeed. My suggestion for a thread group is more or less wrapper functionality.


Quoting - pvonkaenel

I have not used it myself, but will it looks like the tbb_thread class has a join method.

Peter

0 Kudos
Bartlomiej
New Contributor I
1,016 Views
It seems to me, you might also find the method:
void task::wait_for_all();
helpful.
0 Kudos
jaredkeithwhite
New Contributor I
1,016 Views
Much appreciated. I will take a look.

Note that I'm not using tasks for my particular problem -- I have to use user threads directly, because this is asynchronous IO that I'm waiting to complete.

Quoting - bartlomiej
It seems to me, you might also find the method:
void task::wait_for_all();
helpful.

0 Kudos
Reply