- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11.4 How Task Scheduling Works
The scheduler evaluates a task graph. The graph is a directed graph where each node
is a task. Each task points to its successor, which is another task that is waiting on it
to complete, or NULL. Method task::parent() gives you read-only access to the
successor pointer. Each task has a refcount that counts the number of tasks that have
it as a successor. The graph evolves over time.
So is it supposed to be "predecessor"?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The leaf tasks get executed first.
I understand your mention of "The successortask can bethe predecessor as well" happens when a task is stolen by another thread.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page