Consider the following set of processes, with the length of the CPU burst given in milliseconds:Process Burst Time PriorityP1 2 2P2 1 1P3 3 4P4 4 2The processes are assumed to have arrived in the order P1, P2, P3, P4, P5,all at time 0. What is the turnaround time of each process for the nonpreemptive Priority scheduling algorithms (a larger priority number implies a higher priority)?A.5, 10, 3, 9B.2, 3, 6, 10C.3, 1, 6, 10D.2, 3, 8, 10
Question
Consider the following set of processes, with the length of the CPU burst given in milliseconds:Process Burst Time PriorityP1 2 2P2 1 1P3 3 4P4 4 2The processes are assumed to have arrived in the order P1, P2, P3, P4, P5,all at time 0. What is the turnaround time of each process for the nonpreemptive Priority scheduling algorithms (a larger priority number implies a higher priority)?A.5, 10, 3, 9B.2, 3, 6, 10C.3, 1, 6, 10D.2, 3, 8, 10
Solution
In non-preemptive priority scheduling, the process with the highest priority (largest number) is executed first. If two processes have the same priority, they are executed in their arrival order.
Here is the step-by-step calculation:
-
At time 0, P1, P2, P3, and P4 arrive. P3 has the highest priority, so it is executed first. It finishes at time 3.
-
Now, P1, P2, and P4 are waiting. P1 and P4 have the same priority, but P1 arrived first, so it is executed next. It finishes at time 5 (3 from P3 + 2 from P1).
-
Now, P2 and P4 are waiting. P2 has the highest priority, so it is executed next. It finishes at time 6 (5 from P1 + 1 from P2).
-
Finally, P4 is executed and it finishes at time 10 (6 from P2 + 4 from P4).
So, the turnaround time for each process is:
- P1: 5 (it finished at time 5)
- P2: 6 (it finished at time 6)
- P3: 3 (it finished at time 3)
- P4: 10 (it finished at time 10)
Therefore, the correct answer is C.3, 1, 6, 10.
Similar Questions
Consider the following set of processes, with the length of the CPU burstgiven in milliseconds:Process Burst Time PriorityP1 2 2P2 1 1P3 8 4P4 4 2P5 5 3The 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 thefollowing scheduling algorithms: FCFS, SJF, nonpreemptive priority (a larger prioritynumber implies a higher priority), and RR (quantum = 2).b. What is the turnaround time of each process for each of the schedulingalgorithms in part a?c. What is the waiting time of each process for each of these scheduling algorithms?d. Which of the algorithms results in the minimum average waiting time (over allprocesses)?
Consider Five Processes P1 to P5 arrived at same time. They have stimated runningtime 10,2,6,8 and 4 seconds, respectively. Their Priorities are 3,2,5,4 and 1,respectively with 5 being highest Priority. Find the average turnaround time andaverage waiting time for Round- Robin(q=3) and Priority Schedulingalgorithm.
Consider the following set of processes :Process Priority Burst ArrivalP1 3 24 0P2 1 30P3 2 30The waiting time of all processes using the RR scheduling algorithms with quantum = 3 is:A.30B.6C.24D.12
Priority rules generally assume that a job's setup time is independent of the sequence of processing jobs.Group startsTrue or FalseTrue, unselectedFalse, unselected
Q5. Consider the set of 6 processes whose arrival time and burst time are given below-Arrival time Burst timeP1 0 6P2 1 7P3 2 8P4 3 10P5 4 3P6 5 4If the CPU scheduling policy is Round Robin with time quantum = 3, calculate the average waiting time andaverage turnaround time. For the given scheduling Algorithm (a) FCFS (b) SJF (c) SRTF
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.