-
Notifications
You must be signed in to change notification settings - Fork 46
Open
Labels
Description
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();
}Reactions are currently unavailable