Skip to content

Commit 81ff6ff

Browse files
committed
feat: added internal design docs
1 parent 2c890a8 commit 81ff6ff

4 files changed

Lines changed: 75 additions & 569 deletions

File tree

design.md

Lines changed: 0 additions & 241 deletions
This file was deleted.

docs/adr/002-phaser-based-coordination.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,36 @@ public void execute() {
8383
}
8484
```
8585

86+
### Two-Phase Completion Sequence
87+
88+
```mermaid
89+
sequenceDiagram
90+
participant Main as Main Thread
91+
participant Step as Step Thread
92+
participant Ph as Phaser
93+
participant EM as ExecutionManager
94+
95+
Note over Ph: Phase 0 (RUNNING)
96+
97+
Main->>Ph: register()
98+
Main->>EM: deregisterActiveThread("Root")
99+
Main->>Ph: arriveAndAwaitAdvance()
100+
Note over Main: BLOCKED
101+
102+
Step->>Step: execute user function
103+
Step->>EM: checkpoint SUCCEED
104+
EM->>Ph: arriveAndAwaitAdvance()
105+
Note over Ph: Phase 1 (COMPLETING)
106+
107+
Note over Main: UNBLOCKED
108+
Main->>EM: registerActiveThread("Root")
109+
Main->>Ph: arriveAndDeregister()
110+
111+
Step->>Ph: arriveAndAwaitAdvance()
112+
Note over Ph: Phase 2 (DONE)
113+
Step->>EM: deregisterActiveThread("1-step")
114+
```
115+
86116
## Consequences
87117

88118
**Positive:**

0 commit comments

Comments
 (0)