Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Asynchronous DAG execution (no intermediate latches) #21

@vittorioromeo

Description

@vittorioromeo

Currently every fork/join in the implicitly generated DAG has a latch that blocks until all the "fork subtasks" are executed. This is not optimal thread pool usage as blocking is not required here and introduces unnecessary overhead.

An asynchronous execution model should be used instead, with a single latch that wraps everything in order to synchronize it with the "rest of the world".

Pseudocode example:

void run_dag()
{
    ecst::latch l(1);
    run_node_0()
        .then(run_node_1())
        .then(run_node_2a(), run_node_2b(), run_node_2c())
        .then(run_node_3())
        .then([&]{ l.arrive(); });

    l.wait();
}

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions