partopo
Execute work described by a dependency graph using either a single-threaded worker or in parallel using a threadpool.
This is an implementation of Kahn's algorithm for topological sorting minimally adapted to be run in parallel.
Usage
use ;
use Instant;
use ;
// Construct a DAG:
// 1 -> 2
// 1 -> 3
// 4 -> 5
// 2 -> 5
let mut dag: = new;
let idx1 = dag.add_node;
let = dag.add_child;
let = dag.add_child;
let idx4 = dag.add_node;
let = dag.add_child;
dag.add_edge.unwrap;
// Example work function
// Execute work on a threadpool
par_execute;
Disclaimer
This is not an officially supported Google product