adv2 - priority vs pip
32 removals
86 lines
32 additions
84 lines
_ _
_ _
| | | |
| | | |
___ ___| |__ ___ __| |
___ ___| |__ ___ __| |
/ __|/ __| '_ \ / _ \/ _` |
/ __|/ __| '_ \ / _ \/ _` |
\__ \ (__| | | | __/ (_| |
\__ \ (__| | | | __/ (_| |
|___/\___|_| |_|\___|\__,_|
|___/\___|_| |_|\___|\__,_|
Spring 2023
Spring 2023
Simulating Priority scheduler
Simulating Priority + PIP Protocol scheduler
****************************************************
****************************************************
N: Forked
N: Forked
X: Finished
X: Finished
=: Blocked
=: Blocked
+n: Acquire resource n
+n: Acquire resource n
-n: Release resource n
-n: Release resource n
- Process 1: Forked at tick 0 and run for 4 ticks with initial priority 0
- Process 1: Forked at tick 0 and run for 4 ticks with initial priority 0
Acquire resource [1] at 0 for 2
Acquire resource [1] at 0 for 2
Acquire resource [2] at 0 for 3
Acquire resource [2] at 0 for 3
Acquire resource [3] at 0 for 4
Acquire resource [3] at 0 for 4
Acquire resource [4] at 0 for 4
Acquire resource [4] at 0 for 4
- Process 2: Forked at tick 1 and run for 3 ticks with initial priority 5
- Process 2: Forked at tick 1 and run for 3 ticks with initial priority 5
Acquire resource [1] at 0 for 2
Acquire resource [1] at 0 for 2
Acquire resource [2] at 1 for 1
Acquire resource [2] at 1 for 1
- Process 3: Forked at tick 2 and run for 4 ticks with initial priority 10
- Process 3: Forked at tick 2 and run for 4 ticks with initial priority 10
Acquire resource [2] at 2 for 2
Acquire resource [2] at 2 for 2
- Process 4: Forked at tick 2 and run for 1 tick with initial priority 30
- Process 4: Forked at tick 2 and run for 1 tick with initial priority 30
Acquire resource [1] at 0 for 1
Acquire resource [1] at 0 for 1
0: N
0: N
0: +[1]
0: +[1]
0: +[2]
0: +[2]
0: +[3]
0: +[3]
0: +[4]
0: +[4]
0: 1
0: 1
-----------------------------------------------
-----------------------------------------------
1: N
1: N
1: =[1]
1: =[1]
-----------------------------------------------
-----------------------------------------------
2: N
2: N
2: N
2: N
2: =[1]
2: =[1]
-----------------------------------------------
-----------------------------------------------
3: 3
3: 1
3: -[1]
-----------------------------------------------
-----------------------------------------------
4: 3
4: +[1]
4: 4
4: -[1]
-----------------------------------------------
-----------------------------------------------
5: =[2]
5: X
5: 3
-----------------------------------------------
-----------------------------------------------
6: 1
6: 3
6: -[1]
-----------------------------------------------
-----------------------------------------------
7: +[1]
7: =[2]
7: 4
7: -[1]
-----------------------------------------------
-----------------------------------------------
8: X
8: 1
8: +[1]
8: -[2]
8: 2
-----------------------------------------------
-----------------------------------------------
9: =[2]
9: +[2]
9: 3
-----------------------------------------------
-----------------------------------------------
10: 1
10: 3
10: -[2]
10: -[2]
-----------------------------------------------
-----------------------------------------------
11: +[2]
11: X
11: 3
11: +[1]
11: 2
-----------------------------------------------
-----------------------------------------------
12: 3
12: +[2]
12: -[2]
12: 2
12: -[1]
12: -[2]
-----------------------------------------------
-----------------------------------------------
13: X
13: +[2]
13: 2
13: 2
13: -[1]
13: -[2]
-----------------------------------------------
14: 2
-----------------------------------------------
-----------------------------------------------
15: X
14: X
15: 1
14: 1
15: -[3]
14: -[3]
15: -[4]
14: -[4]
-----------------------------------------------
-----------------------------------------------
16: X
15: X