-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ch. 17: diagrams for concurrent and parallel execution
- Loading branch information
1 parent
eb41efb
commit cfaf187
Showing
2 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
digraph { | ||
dpi = 300.0; | ||
|
||
Parallel [label = "Parallel";shape = "plaintext";]; | ||
rankdir = "TB"; | ||
splines = false; | ||
cluster = true; | ||
|
||
node [shape = diamond;]; | ||
|
||
subgraph cluster_ColleagueA { | ||
newrank = true; | ||
label = "Task 1"; | ||
A1 -> A2 -> A3 -> A4; | ||
} | ||
|
||
subgraph cluster_ColleagueB { | ||
label = "Task 2"; | ||
B1 -> B2 -> B3; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
digraph { | ||
dpi = 300.0; | ||
|
||
Concurrent [label = "Concurrent";shape = "plaintext";]; | ||
rankdir = "TB"; | ||
splines = false; | ||
cluster = true; | ||
|
||
node [shape = diamond;]; | ||
|
||
subgraph cluster_task_a { | ||
label = "Task A"; | ||
|
||
// makes ordering between subgraphs work | ||
newrank = true; | ||
|
||
A1; | ||
A2; | ||
A3; | ||
A4; | ||
|
||
// for vertical alignment purposes only | ||
A0 [style = invis;]; | ||
|
||
edge [style = invis;]; | ||
} | ||
|
||
subgraph cluster_task_b { | ||
label = "Task B"; | ||
cluster = true; | ||
|
||
// for vertical alignment purposes only | ||
newrank = true; | ||
|
||
B0 [style = invis;]; | ||
|
||
B1; | ||
B2; | ||
B3; | ||
} | ||
|
||
A1 -> B1 -> A2 -> B2 -> A3 -> A4 -> B3; | ||
|
||
// Makes the heights line up between the boxes. | ||
A4 -> A0 [style = invis;]; | ||
} |