|
Honeycomb
0.1
Component-Model Framework
|
Scheduler that serializes and parallelizes task execution given a dependency graph of tasks and a pool of threads. More...
#include <DepTask.h>
Public Member Functions | |
| DepSched (thread::Pool &pool) | |
| bool | reg (DepTask &task) |
| Register a task, linking it into this scheduler's dependency graph. More... | |
| bool | unreg (DepTask &task) |
| Unregister a task. Returns false if not registered. More... | |
| bool | enqueue (DepTask &task) |
| Schedule a task for execution. Returns false if task is already active. More... | |
Static Public Member Functions | |
| static | mt_global (DepSched, inst,(future::AsyncSched::inst())) |
| Get singleton, uses global future::AsyncSched pool. More... | |
Static Public Attributes | |
| static bool | trace = false |
| Whether to log task execution flow. More... | |
Friends | |
| class | DepTask |
Scheduler that serializes and parallelizes task execution given a dependency graph of tasks and a pool of threads.
To run a task, first register it and any dependent tasks with DepSched::reg(), then call DepSched::enqueue(rootTask).
| honey::DepSched::DepSched | ( | thread::Pool & | pool | ) |
| pool | Shared ref to thread pool with which all tasks will be enqueued. |
| bool honey::DepSched::enqueue | ( | DepTask & | task | ) |
Schedule a task for execution. Returns false if task is already active.
Enqueuing a task performs a binding:
root task, and the entire subgraph of upstream tasks (dependencies) are bound to this rootA task can be enqueued again once it is complete. Wait for completion by calling DepTask_::future().get(). Be wary of enqueueing tasks that are upstream of other currently active tasks.
This method will error if:
task is not registeredtask or any upstream tasks are active
|
static |
Get singleton, uses global future::AsyncSched pool.
| bool honey::DepSched::reg | ( | DepTask & | task | ) |
Register a task, linking it into this scheduler's dependency graph.
Tasks can be registered with multiple schedulers.
| bool honey::DepSched::unreg | ( | DepTask & | task | ) |
Unregister a task. Returns false if not registered.
|
friend |
|
static |
Whether to log task execution flow.
1.8.10