Knowee
Questions
Features
Study Tools

Suppose that the following processes arrive for execution at the times indicated.Each process will run for the amount of time listed. In answering the questions, usenonpreemptive scheduling, and base all decisions on the information you have at the timethe decision must be made.Process Arrival Time Burst TimeP1 0.0 8P2 0.4 4P3 1.0 1a. What is the average turnaround time for these processes with the FCFSscheduling algorithm?b. What is the average turnaround time for these processes with theSJF scheduling algorithm?c. The SJF algorithm is supposed to improve performance, but notice that we choseto run process P1 at time 0 because we did not know that two shorter processes wouldarrive soon. Compute what the average turnaround time will be if the CPU is left idle forthe first 1 unit and then SJF scheduling is used. Remember that processes P1 and P2 arewaiting during this idle time, so their waiting time may increase. This algorithm could becalled future-knowledge scheduling.Exercises 3.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 3

Question

Suppose that the following processes arrive for execution at the times indicated.Each process will run for the amount of time listed. In answering the questions, usenonpreemptive scheduling, and base all decisions on the information you have at the timethe decision must be made.Process Arrival Time Burst TimeP1 0.0 8P2 0.4 4P3 1.0 1a. What is the average turnaround time for these processes with the FCFSscheduling algorithm?b. What is the average turnaround time for these processes with theSJF scheduling algorithm?c. The SJF algorithm is supposed to improve performance, but notice that we choseto run process P1 at time 0 because we did not know that two shorter processes wouldarrive soon. Compute what the average turnaround time will be if the CPU is left idle forthe first 1 unit and then SJF scheduling is used. Remember that processes P1 and P2 arewaiting during this idle time, so their waiting time may increase. This algorithm could becalled future-knowledge scheduling.Exercises 3.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 3

...expand
🧐 Not the exact question you are looking for?Go ask a question

Solution

a. FCFS (First-Come, First-Served) Scheduling Algorithm:

Turnaround time is the total time between submission of a process and its completion.

Turnaround Time for P1 = Completion Time - Arrival Time = 8 - 0 = 8 Turnaround Time for P2 = Completion Time - Arrival Time = (8 + 4) - 0.4 = 11.6 Turnaround Time for P3 = Completion Time - Arrival Time = (8 + 4 + 1) - 1 = 12

Average Turnaround Time = (Turnaround Time for P1 + Turnaround Time for P2 + Turnaround Time for P3) / 3 = (8 + 11.6 + 12) / 3 = 10.53

b. SJF (Shortest Job First) Scheduling Algorithm:

Turnaround Time for P1 = Completion Time - Arrival Time = (1 + 4 + 8) - 0 = 13 Turnaround Time for P2 = Completion Time - Arrival Time = (1 + 4) - 0.4 = 4.6 Turnaround Time for P3 = Completion Time - Arrival Time = 1 - 1 = 0

Average Turnaround Time = (Turnaround Time for P1 + Turnaround Time for P2 + Turnaround Time for P3) / 3 = (13 + 4.6 + 0) / 3 = 5.87

c. Future-Knowledge Scheduling:

If the CPU is left idle for the first 1 unit:

Turnaround Time for P1 = Completion Time - Arrival Time = (1 + 1 + 8) - 0 = 10 Turnaround Time for P2 = Completion Time - Arrival Time = (1 + 1 + 4) - 0.4 = 5.6 Turnaround Time for P3 = Completion Time - Arrival Time = 1 - 1 = 0

Average Turnaround Time = (Turnaround Time for P1 + Turnaround Time for P2 + Turnaround Time for P3) / 3 = (10 + 5.6 + 0) / 3 = 5.2

Exercise 3:

For the given set of processes, the CPU burst time and priority are given. However, the scheduling algorithm is not specified. Depending on the scheduling algorithm used (Priority Scheduling, Round Robin, SJF, FCFS, etc.), the average turnaround time will vary.

This problem has been solved

Similar Questions

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

find average turnaround time using preemptive SJF ProcessArrival TimeBurst TimeP108P214P329P435

Solve following example by FCFS and SJF CPU schedulingalgorithm. Draw Gantt Chart and calculate Average Waiting Timeand Average Turnaround time.Process Arrival Time Burst TimeP0 0 10P1 1 6P2 3 2P3 5 4

Consider the given table below and find Completion time (CT), Turn-around time (TAT), Waiting time (WT), Response time (RT), Average Turn-around time and Average Waiting time in case of FCFS scheduling. Process ID Arrival time Burst time P1 2 2 P2 5 6 P3 0 4 P4 0 7 P5 7 4a.The waiting time for process P1 is 9msb.The waiting time for process P1 is 0msc.The waiting time for process P1 is 8msd.The waiting time for process P1 is 4ms

Five batch jobs A, B, C, D and E arrive at same time. They haveestimated running times 10, 6, 3, 4 and 8 ms. For each of the followingalgorithm determine mean process turnaround time. Consider processswapping overhead is 1 ms.1) FCFS2) Round-Robin (Time quantum = 2 ms)

1/3

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.