ind average turnaround time using SJF?ProcessArrival TimeBurst TimeP107P214P329P435Select one:a. 14.50b. 13c. 13.25d. 14
Question
ind average turnaround time using SJF?ProcessArrival TimeBurst TimeP107P214P329P435Select one:a. 14.50b. 13c. 13.25d. 14
Solution
To calculate the average turnaround time using Shortest Job First (SJF) scheduling, we first need to understand that in SJF, the process with the smallest burst time is executed first.
Given the data:
Process Arrival Time Burst Time P1 0 7 P2 1 4 P3 2 9 P4 3 5
First, we arrange the processes according to their arrival times and then burst times. At time 0, P1 arrives with burst time 7. At time 1, P2 arrives with burst time 4, which is less than the remaining time of P1, so P2 is executed first.
The Gantt chart would look like this:
0 P1 1 P2 5 P4 10 P1 17 P3 26
Now, we calculate the turnaround time for each process:
Turnaround time = Completion time - Arrival time
For P1: 17 - 0 = 17 For P2: 5 - 1 = 4 For P3: 26 - 2 = 24 For P4: 10 - 3 = 7
Then, we calculate the average turnaround time:
Average turnaround time = (Turnaround time of P1 + Turnaround time of P2 + Turnaround time of P3 + Turnaround time of P4) / 4
Average turnaround time = (17 + 4 + 24 + 7) / 4 = 13
So, the average turnaround time using SJF is 13. Therefore, the correct answer is b. 13.
Similar Questions
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
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
find average turnaround time using FCFSProcess Arrival Time Burst Time wt tat ctP1 0 8 0 8 8P2 1 4 7 11 12P3 2 9 10 19 21P4 3 5 18 23 26Formula usedTATi = Wti + BTiCTi = TATiCTi+1 = Cti + BTi+iWti+1=CTi-ATi+1
find average waiting time using Round Robin (time slice=4ms)? ProcessArrival TimeBurst TimeP108P214P329P435 Select one:a. 12.25b. 11.75c. 11d. 10
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)
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.