34 lines
1.3 KiB
Text
34 lines
1.3 KiB
Text
// Buffer-slot state engine of the io_uring video demo.
|
|
// Render: dot -Tsvg state-engine.dot -o state-engine.svg
|
|
//
|
|
// The BuffState of each ring slot is written and read ONLY by the Proactor
|
|
// thread; the single SHOW->FREE transition is triggered by the GUI thread
|
|
// clearing the atomic baton (toDisplay_), but observed and enacted here.
|
|
|
|
digraph BuffState {
|
|
rankdir=LR;
|
|
bgcolor="transparent";
|
|
labelloc="t";
|
|
fontname="sans-serif";
|
|
fontsize=14;
|
|
label="Life-cycle of one buffer »slot«";
|
|
|
|
node [shape=circle, fixedsize=true, width=0.9,
|
|
fontname="sans-serif", fontsize=12, style=filled, penwidth=1.4];
|
|
edge [fontname="sans-serif", fontsize=10];
|
|
|
|
FREE [fillcolor="#dbe9ff"];
|
|
READ [fillcolor="#ffedcc"];
|
|
FEED [fillcolor="#d8f0d8"];
|
|
SHOW [fillcolor="#e7d8ff"];
|
|
STOP [shape=doublecircle, width=0.85, fillcolor="#ffd6d6"];
|
|
|
|
FREE -> READ [label=" submit read\l addNextReadSubmissions()\l"];
|
|
READ -> FEED [label=" read completed OK\l handleCompletedRead()\l"];
|
|
READ -> STOP [label=" short read / EOF ", fontcolor="#a00000", color="#a00000"];
|
|
FEED -> SHOW [label=" publish frame\l maybeDisplayFrame()\l"];
|
|
SHOW -> FREE [label=" GUI released frame\l (toDisplay_ == nullptr)\l",
|
|
fontcolor="#5a2ca0", color="#5a2ca0", constraint=false];
|
|
|
|
{ rank=same; FREE; }
|
|
}
|