Chapter 2 - Exercises
Chapter 2 - Exercises
Chapter 2 - Exercises
1.2 GIVEN THE LIST OF THE PROCESSES IN THE FOLLOWING QUEUE IN THE FORM OF DURATION P1 (4), P2(45), P3(5), P4(33), P5(71)
1.3 GIVEN THE LIST OF THE PROCESSES IN THE FOLLOWING QUEUE IN THE FORM OF DURATION P1 (49), P2(45), P3(15), P4(73)
(Trong các bài đề bài không đề cập đến thời gian xuất hiện thì hiểu là thời gian xuất hiện cùng là 0)
FCFS
1.1. P1 => P2 => P3 => P4 => P5.
NON-PREEMPTIVE STF
1.1. P4 => P3 => P5 => P2 => P1.
1.2. P1(4/4) => P2(12/45) => P3(5/5) => P4(12/33) => P5(12/71) => P2(24/45) => P4(24/33) => P5 (24/71) => P2(36/45) => P4(33/33) =>
P2(36/45) => P5(36/71) => P2(45/45) => P5(71/71)
1.3. P1(12/49) => P2(12/45) => P3(12/15) => P4(12/73) => P1(24/49) => P2(24/45) => P3(15/15) => P4(24/73) => P1(36/49) => P2(36/45) =>
P4(36/73) => P1(48/49) => P2(45/45) => P4(48/73) => P1(49/49) => P4(73/73).
2
2. APPLY THE CPU SCHEDULING ALGORITHMS: FCFS, NON-
PREEMPTIVE STF, SRTF (PREEMPTIVE STF), ROUND-ROBIN (WITH TIME
QUANTUM=15) FOR FOLLOWING QUEUES.
2.1 GIVEN THE LIST OF THE PROCESSES IN THE FOLLOWING QUEUE IN THE FORM OF (ARRIVAL TIME, DURATION) P1 (0, 45), P2(3, 23), P3(8,
10), P4(12, 3), P5(40, 17)
2.2 GIVEN THE LIST OF THE PROCESSES IN THE FOLLOWING QUEUE IN THE FORM OF (ARRIVAL TIME, DURATION) P1 (0, 4), P2(5, 45), P3(8,
5), P4(10, 33), P5(15, 71)
2.3 GIVEN THE LIST OF THE PROCESSES IN THE FOLLOWING QUEUE IN THE FORM OF (ARRIVAL TIME, DURATION) P1 (0, 49), P2(17, 45),
P3(20, 15), P4(31, 73)
FCFS
2.1. P1 => P2 => P3 => P4 => P5.
NON-PREEMPTIVE STF
2.1. P1 => P4 => P3 => P5 => P2.
3
SRTF (PREEMPTIVE STF)
2.1. P1(3/45) => P2(5/23) => P3(4/10) => P4(3/3) => P3(10/10) => P2(23/23) => P5(17/17) => P1(45/45)
2.2. P1(4/4) => P2(3/45) => P3(5/5) => P4(33/33) => P2(45/45) => P5(71/71).
2.3. P1(20/49) => P3(15/15) => P1(49/49) => P2(45/45) => P4(73/73).
2.2. P1(4/4) => P2(12/45) => P3(5/5) => P4(12/33) => P5(12/71) => P2(24/45) => P4(24/33) => P5(24/71) => P2(36/45) => P4(33/33) =>
P2(45/45) => P5(71/71).
2.3. P1(24/49) => P2(12/45) => P3(12/15) => P1(36/49) => P4(12/73) => P2(24/45) => P3(15/15) => P1(48/49) => P4(24/73) => P2(36/45) =>
P1(49/49) => P4(36/73) => P2(45/45) => P4(73/73).
4
3 EVALUATE THE ABOVE ALGORITHMS WITH THE METRICS:
THROUGHPUT, TURNAROUND TIME, RESPONSE TIME, WAITING TIME
AS WELL AS THEIR AVERAGE VALUES