Skip to main content

Module shared_graph

Module shared_graph 

Source
Expand description

SharedGraph<N, E> - cross-process directed graph with arbitrary out-degree.

Nodes carry N values; edges carry E values + destination index. Adjacency stored as per-node linked lists of edges (each edge has a next_in_src_list link to the next edge from the same source).

§Files

  • <base>.nodes.bin - SharedRegion<GraphNode<N>>
  • <base>.edges.bin - SharedRegion<GraphEdge<E>>

§Concurrency

SINGLE-WRITER, MULTI-READER. Reads (neighbors, node_value, edge_value, iter) are lock-free. Writes (add_node, add_edge, remove_edge) require external serialisation.

§Safety

  • Bounded capacity at create (both regions).
  • SharedRegion’s ABA-safe free list backs slot reuse.
  • No spin loops, no Drop guards, no atomic underflow risk.

Structs§

EdgeIndex
GraphEdge
GraphNode
NodeIndex
SharedGraph

Enums§

GraphError

Constants§

NIL_INDEX