Intel® oneAPI Threading Building Blocks
Ask questions and share information about adding parallelism to your applications when using this threading library.
Announcements
The Intel sign-in experience has changed to support enhanced security controls. If you sign in, click here for more information.

void task_group::run()

Jeff_Masselink
Beginner
147 Views

void task_group::run().

1) Since the function returns void, howan application knowsthe function successfully returned? Is there an exception thrown if something wrongin failure cases ?

2) The similar question, since the task_group::run is asynchrnized, for a task in a task group, how the application checks the status of the task, like when it is created, scheduled and run successfully?

Thanks!

0 Kudos
1 Reply
Kirill_R_Intel
Employee
147 Views
Hellp Jeff,

task_group::run() just allows the task group to start. It doesn't mean all the tasks begin execute simultaneously. Once we called run, we don't have info about task completion status, and even about task starting status because it's too early for this. The status can be seen only when we call wait() - it returns status and you can check for exceptions there also.
So the wait() method is the place to check status, not run().

Regards,
Kirill
Reply