Proposal for threaded call graphs
Using Mermaid in Markdown, it is easy to draw simple graphs. The layout is completely automatic, based on constraints from the graphs themselves. This could be used to describe, in a precise way, the (synchronous) call graph and (asynchronous) message passing in a large multithreaded program like OAI.
The trivial graph below has the following semantics:
- Thread1 executes A, B, and C sequentially
- Inside B, a message is sent out to Thread2 so that it starts the D, E, F sequence
flowchart TB
subgraph Thread2
D --> E --> F
end
subgraph Thread1
A --> B --> C
end
B -.-> D
A more involved example covers the frontend processing spread over two threads, and the full slot resynchronized before feeding the decoder:
flowchart TB
subgraph Thread2
DFT2[DFT] --> Demodulation2[Demodulation]
end
subgraph Thread1
DFT1[DFT] --> Demodulation1[Demodulation]
end
subgraph USRPinput
StoreSym0 --> etc1[...] --> StoreSym13 --> SlotReady --> StoreSym0
end
SlotReady -.->|Sym0..6| DFT1
SlotReady -.->|Sym7..13| DFT2
subgraph Decoder
DecodeFullSlot
end
Demodulation1 -.-> |Sym0..6| DecodeFullSlot
Demodulation2 -.-> |Sym7..13| DecodeFullSlot
An alternative is the Sequence Diagram
. We can use it to convey the same basic asynchronous/asynchronous distinction:
sequenceDiagram
participant USRPinput
participant Thread1
participant Thread2
participant Decoder
Note over USRPinput: StoreSym0
Note over USRPinput: ...
Note over USRPinput: StoreSym13
Note over USRPinput: SlotReady
USRPinput-->>Thread1: Sym0..6
USRPinput-->>Thread2: Sym7..13
Note over Thread1: DFT
Note over Thread2: DFT
Note over Thread1: Demodulation
Note over Thread2: Demodulation
Thread1-->>Decoder: Sym0..6
Thread2-->>Decoder: Sym7..13
Note over Decoder: DecodeFullSlot
Edited by Alexandre Ferrieux