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, 9
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, 9
Solution
In non-preemptive priority scheduling, the CPU is allocated to the process with the highest priority. If two processes have the same priority, then the CPU is allocated to the process with the earliest arrival time.
Here, the processes have arrived in the order P1, P2, P3, P4.
Let's calculate the turnaround time for each process:
-
P1: The burst time is 2ms. Since it's the first process to arrive, it gets the CPU first. So, the turnaround time for P1 is 2ms (completion time - arrival time = 2 - 0 = 2ms).
-
P2: The burst time is 1ms. It has the highest priority among the remaining processes. So, it gets the CPU next. The CPU has been busy for 2ms executing P1, so P2 starts at 2ms and finishes at 3ms. Therefore, the turnaround time for P2 is 3ms (3 - 0 = 3ms).
-
P4: The burst time is 4ms. It has the next highest priority. So, it gets the CPU next. The CPU has been busy for 3ms executing P1 and P2, so P4 starts at 3ms and finishes at 7ms. Therefore, the turnaround time for P4 is 7ms (7 - 0 = 7ms).
-
P3: The burst time is 3ms. It has the lowest priority. So, it gets the CPU last. The CPU has been busy for 7ms executing P1,
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.