Function layout_2013::parallel::bottom_up_flow

source ·
fn bottom_up_flow(
    unsafe_flow: UnsafeFlow,
    assign_bsize_traversal: &AssignBSizes<'_>,
)
Expand description

Process current flow and potentially traverse its ancestors.

If we are the last child that finished processing, recursively process our parent. Else, stop. Also, stop at the root.

Thus, if we start with all the leaves of a tree, we end up traversing the whole tree bottom-up because each parent will be processed exactly once (by the last child that finishes processing).

The only communication between siblings is that they both fetch-and-subtract the parent’s children count.