void task_group::run()

void task_group::run()

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?


2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

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().


Leave a Comment

Please sign in to add a comment. Not a member? Join today