Community
cancel
Showing results for 
Search instead for 
Did you mean: 
jaredkeithwhite
New Contributor I
98 Views

Thread Group

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
98 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?
jaredkeithwhite
New Contributor I
98 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?



pvonkaenel
New Contributor III
98 Views

Quoting - jaredkeithwhite




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

Peter
jaredkeithwhite
New Contributor I
98 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

Bartlomiej
New Contributor I
98 Views

It seems to me, you might also find the method:
void task::wait_for_all();
helpful.
jaredkeithwhite
New Contributor I
98 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.

Reply