Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Asynchronous DAG execution (no intermediate latches) #21

Open
vittorioromeo opened this issue Jan 5, 2017 · 0 comments
Open

Asynchronous DAG execution (no intermediate latches) #21

vittorioromeo opened this issue Jan 5, 2017 · 0 comments

Comments

@vittorioromeo
Copy link
Owner

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();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant