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

void task_group::run()

Jeff_Masselink
Beginner
109 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
109 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