(d) Pre-emptive priority scheduling [4 marks]:
Consider the following set of processes, with the length of the CPU-burst time given in milliseconds:
Process |
Burst |
Priority |
Arrival Time |
P1 |
8 |
3 |
0 |
P2 |
3 |
4 |
1 |
P3 |
6 |
2 |
3 |
P4 |
3 |
1 |
5 |
P5 |
1 |
5 |
7 |
P6 |
3 |
8 |
14 |
P7 |
8 |
5 |
18 |
(d-1) Draw Gantt chart illustrating the execution of these processes using pre-emptive priority (a smaller priority number implies a higher priority) [2 marks]
00 01 02 03 04 05 06 07 08 09 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 |
(d-2) Compute the turnaround time of all processes in the previous question [2 mark]
Process |
Turnaround Time |
P1 |
|
P2 |
|
P3 |
|
P4 |
|
P5 |
|
P6 |
|
P7 |
|
Average Turnaround Time |
Q(d)
(d)-1
Sol:
We have the required Gantt Chart as follows:
Which can be explained as follows:
(Note that all times are in millisecond(ms))
(d)-2
Sol:
We know that Turnaround Time = Completion Time - Arrival Time
So, we have the required table as follows (here completion time is found using the gantt chart where last executing time of the process is written):
Process | Arrival Time(in ms) | Completion Time(in ms) | Turnaround Time(in ms) |
P1 | 0 | 17 | 17 - 0 = 17 |
P2 | 1 | 20 | 20 - 1 = 19 |
P3 | 3 | 12 | 12 - 3 = 9 |
P4 | 5 | 8 | 8 - 5 = 3 |
P5 | 7 | 21 | 21 - 7 = 14 |
P6 | 14 | 32 | 32 - 14 = 18 |
P7 | 18 | 29 | 29 - 18 = 11 |
Average Turnaround Time = Sum of Turnaround times of all the processes/Number of processes
= (17 + 19 + 9 + 3 + 14 + 18 + 11)/7
= 91/7
= 13 ms (Ans.)
(Thank You !!, Please consider upvoting if it was helpful !!)
(d) Pre-emptive priority scheduling [4 marks]: Consider the following set of processes, with the length of...
Consider the following set of processes, with the length of the CPU-burst time given in milliseconds: Process Burst Time Priority P1 10 3 P2 1 1 P3 2 3 P4 1 4 P5 5 2 The processes are assumed to have arrived in the order P1, P2, P3, P4, P5, all at time 0. a. Draw four Gantt charts illustrating the execution of these processes using FCFS, SJF (SPN), a...
QUESTION 1 Consider the following set of processes, with the length of the CPU burst time given in milliseconds: Process Burst Time Priority P1 7 5 P2 2 4 P3 11 3 P4 9 1 P5 5 3 The processes are assumed to have arrived in the order P1,P2, P3, P4, P5, all at time 0. a. Draw four Gantt charts that illustrate the execution of these processes using the following scheduling algorithms: FCFS, SJF, nonpreemptive priority (a smaller priority number implies a higher priority), and RR (quantum = 2). b. What...
Consider the following set of processes, with the length of the CPU-burst time given in milliseconds: Process Burst Time Priority P1 5 4 P2 3 1 P3 1 2 P4 7 2 P5 4 3 The processes are assumed to have arrived in the order P1, P2, P3, P4, P5, all at time 0. If nonpreemptive priority (a larger priority number implies a higher priority) is used, what is the average turnaround time of...
Computer Science Help Instructions Consider the following set of processes, with the length of the CPU-burst time given in milliseconds: Burst Time Process P1 P2 Priority 10 4 The processes are assumed to have arrived in the order P1, P2, P3, P4, P5, all at time 0. a. Draw four Gantt charts illustrating the execution of these processes using FCFS, a nonpreemptive priority (a smaller priority number implies a higher priority), and RR (quantum 1) scheduling. b. What is the...
Please answer the following question in C++ language Consider the following set of processes, with the length of the CPU burst time given in milliseconds: Process Burst Time Priority P1. 7 5 P2 2 4 P3 11 3 P4 9 1 P5 5 3 The processes are assumed to have arrived in the order P1,P2, P3, P4, P5, all at time 0. a. Draw four Gantt charts that illustrate the execution of these processes using the following scheduling algorithms: FCFS, SJF, nonpreemptive...
Consider the following set of processes, with the length of the CPU burst given in milliseconds:ProcessBurst TimePriorityP1 54P231P312P472P543The processes are assumed to have arrived in the order P1 , P2 , P3 , P4 , P5 , all at time 0. a. Draw four Gantt charts that illustrate the execution of these processes using the following scheduling algorithms: FCFS, SJF, nonpreemptive priority (a larger priority number implies a higher priority), and RR (quantum = 2). b. What is the turnaround time of each...
Given the following set of processes with corresponding execution times (in ms), arrival times and priority (1 – highest). For each scheduling algorithm: Construct a table showing which process is active and for how long until all processes are completely serviced (as done in class). Calculate the average waiting time and turnaround time. Process ID Burst (ms) Arrival time P1 9 0 P2 12 0 P3 3 0 P4 30 0 P5 20 0 P6 10 0 First Come First Serve...
Q.2] Answer the following questions Process Burst Time Priority P1 3 1 P2 8 3 P3 2 4 P4 4 5 P5 5 1 (21 points) Consider the set of processes shown in the table above, with the length of the CPU-burst time given in milliseconds. The processes are assumed to have arrived in the order P5, P4, P3, P2 , and P1, all approximately at time 0. Draw three Gantt charts illustrating the execution of these processes using SJF,...
Consider the following set of processes, with the length of CPU burst in milliseconds. Process PI P2 P3 P4 P5 Arrival time 00 02 03 06 30 Burst time 10 12 14 16 05 Draw a Gantt chart that illustrates the execution of these processes using the preemptive shorte st job first (SJF) algorithm. Hence find the average waiting time. Draw a Gantt chart that illustrate the execution of these processes using preemptive priority scheduling algorithm. Given priority of each...
Consider the following set of processes, with the length of the CPU burst times given in milliseconds:a. Draw four Gantt charts illustrating the execution of the processes using FCFS, Preemptive SJF, a non-preemptive priority, and a RR (quantum=2) scheduling. (30 pts)Note: for the RR consider that the arriving time is 0 for all processesb. What is the average waiting time of each process for of the above scheduling algorithms? (10 pts)P1 8 2 0 P2 5 36P3 1 1 8...