Expand description
Building the dependency graph of a region and generating its concurrent schedule.
A region is a run of nodes between barriers. Its graph has an edge u -> v whenever v
must wait for u (depends). Nodes with a single predecessor whose predecessor has a single
successor are fused into chains, so per-item pipelines (a1 -> b1, a2 -> b2) proceed
independently. Chains are then leveled; each level with two or more chains becomes one join of
their futures, and the results are bound in program order.
Structs§
- Chain
Code 🔒 - Generated code for one chain.
- DropMut 🔒
- Drops
mutfrom bindings the chain does not write. - Plan 🔒
- The schedule of one region.
- Strip
Hints 🔒 - Removes psync’s hint attributes (
seq,fresh,independent), which only guide the analysis.
Functions§
- cert_
nodes 🔒 - Each node’s places, for the region’s certificate: one place per reason
dependscan give, so that two nodes have no edge only if neither writes a place the other touches (the checker inverify/Cert.leanmay be stricter thandepends, never more lenient). - chain_
code 🔒 - Generate a chain body: the members’ statements in order, with early exits recorded instead of
taken.
neededlists names used after the chain;extraadds bindings defined outside the members (a loop’s pattern) that should be handed back too. - chain_
code_ 🔒with chain_code, optionally storing the index of the member about to run in the atomicprogress(synchronous code: a panic is replayed at the member that raised it).- depends 🔒
- Why
b(later in the program) must wait fora(earlier), if it must. - emit 🔒
- Generate a region’s statements from its plan.
positionsare the nodes’ statement indices in the block andmentionswhat each statement of the block mentions. - plan 🔒
- Build the graph, fuse chains and level them.
- reachable 🔒
- The nodes that (transitively) depend on
from; nodes are in program order, so edges go forward. - strip_
expr_ 🔒hints - Removes hints from an expression statement’s own attributes.