1Q. First Come First Served (FCFS)
1Q. First Come First Served (FCFS)
Given Data:
Process Arrival Time Burst Time Turnaround Time (TAT) Waiting Time
P1 0 10 10 0
P2 3 6 13 7
P3 7 1 10 9
P4 8 3 12 9
P5 10 4 14 10
Given Data:
Process Arrival Time Burst Time
P1 0 10
P2 3 6
P3 7 1
P4 8 3
P5 10 4
SJF Calculations:
Process Arrival Time Burst Time Turnaround Time (TAT) Waiting Time
P1 0 10 10 0
P3 7 1 4 3
P2 3 6 14 8
P4 8 3 12 9
P5 10 4 14 10
2Q.
Initialization:
We'll simulate each time unit and switch processes as per the Round Robin rules.
Time Process Execution Remaining Burst Times (P1, P2, P3, P4, P5)
0 P1 P1 (1ms) 9, 6, 1, 3, 4
1 P1 P1 (1ms) 8, 6, 1, 3, 4
2 P1 P1 (1ms) 7, 6, 1, 3, 4
3 P2 P2 (1ms) 7, 5, 1, 3, 4
4 P1 P1 (1ms) 6, 5, 1, 3, 4
5 P2 P2 (1ms) 6, 4, 1, 3, 4
6 P1 P1 (1ms) 5, 4, 1, 3, 4
7 P3 P3 (1ms) 5, 4, 0, 3, 4
8 P1 P1 (1ms) 4, 4, 0, 3, 4
9 P4 P4 (1ms) 4, 4, 0, 2, 4
10 P5 P5 (1ms) 4, 4, 0, 2, 3
11 P1 P1 (1ms) 3, 4, 0, 2, 3
12 P2 P2 (1ms) 3, 3, 0, 2, 3
13 P1 P1 (1ms) 2, 3, 0, 2, 3
14 P2 P2 (1ms) 2, 2, 0, 2, 3
15 P1 P1 (1ms) 1, 2, 0, 2, 3
16 P2 P2 (1ms) 1, 1, 0, 2, 3
17 P1 P1 (1ms) 0, 1, 0, 2, 3
18 P2 P2 (1ms) 0, 0, 0, 2, 3
19 P4 P4 (1ms) 0, 0, 0, 1, 3
20 P4 P4 (1ms) 0, 0, 0, 0, 3
21 P5 P5 (1ms) 0, 0, 0, 0, 2
22 P5 P5 (1ms) 0, 0, 0, 0, 1
23 P5 P5 (1ms) 0, 0, 0, 0, 0
Completion Times:
P1: 17
P2: 18
P3: 7
P4: 20
P5: 23
1. P2 (Priority 1)
2. P3 (Priority 2)
3. P4 (Priority 2)
4. P5 (Priority 3)
5. P1 (Priority 4)
Process Arrival Time Burst Time Completion Time TAT Waiting Time
P2 0 6 6 6 0
Process Arrival Time Burst Time Completion Time TAT Waiting Time
P3 0 1 7 7 6
P4 0 9 16 16 7
P5 0 3 19 19 16
P1 0 8 27 27 19