Link Copied
Actually stealing isorthogonal here.
I meant that the"parent" task can create "child" tasks, spawn those, and wait for their completion - in this case it's both predecessor and successor. However a parent task may as wellcreate a separate successor task that will execute after competion of children; we also call it "continuation task". In this case, the parent task is the predecessor for its children, and the continuation task is the successor. See section 11.5.2 "Continuation passing" in the Tutorial.
Also as you may guess from the above, "leaf tasks get executed first" is not totally correct as well. It's really a dynamic tree of tasks that create and spawn other tasks during the execution, and may or may not explicitly wait for completion of those.
For more complete information about compiler optimizations, see our Optimization Notice.