-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhighLevelDesign.txt
53 lines (42 loc) · 1.11 KB
/
highLevelDesign.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
struct HistoryLinkedList{
head;
tail;
size;
capacity;
}
historyAdd(&history, input) {
// add the input line to the history
}
historyClear(&history) {
// clear the history
}
// the main function should have the loop that processes all of the commands
main {
while (true) {
input = getInput;
historyAdd(input)
commands = getCommandsFromInput(input)
execComamnds(commands);
}
return;
}
getInput() {
// get the input from the user
}
getCommandsFromInput(input) {
// return the list of commands from the input
}
execComamnds() {
// execute the supplied commands
When executing the commands I will allocate space
for the pipes that I need and the children processes
then after allocating them I will orchestrate the great
magic of them working together
This is a table describing the workflow
read ; process ; write
stdin ; cpid0 ; pipe[0][write]
pipe[0][read] ; cpid1 ; pipe[1][write]
pipe[1][read] ; cpid2 ; pipe[2][write]
...
pipe[n-1][read] ; cpidn ; stdout
}