1 1 vote Consider a Shortest Job First (SJF) CPU scheduler, with the following process workload: Process Arrival Time CPU Burst $P1$ $t$ $5$ $P2$ $t+6$ $7$ $P3$ $t+10$ $5$ $P4$ $t+2$ $3$ $P5$ $t+8$ $9$ $P6$ $t+4$ $1$ Assume that the CPU is free and no other processes exist in the ready queue when P1 enters the ready queue at time t. Determine the schedule of process execution and compute the wait times for each of the above six processes. Which of the following is a TRUE statement about the average wait time and the maximum wait time for the six processes? a) The average wait time is between 5.0 and 5.5 time units; the maximum wait time is between 11 and 12 time units. b) The average wait time is between 4.0 and 4.5 time units; the maximum wait time is between 12 and 13 time units. c) The average wait time is between 3.5 and 4.0 time units; the maximum wait time is between 11 and 12 time units. d) The average wait time is between 4.5 and 5.0 time units; the maximum wait time is between 11 and 12 time units. Operating System operating-system process-scheduling + – Nancy Pareta 804 views answer comment Share Follow Print 0 reply Please log in or register to add a comment.
Best answer 2 2 votes Answer : B Assuming Non-preemptive SJF algorithm (Because if it were Preemptive then they would have used SRTF or Preemptive SJF terminology ) Gantt Chart : $t$ to $t+5$ $t+5$ to $t+6$ $t+6$ to $t+9$ $t+9$ to $t+16$ $t+16$ to $t+21$ $t+21$ to $t+30$ P1 P6 P4 P2 P3 P5 So, Waiting times of all the processes : Process Waiting time P1 0 P2 3 P3 6 P4 4 P5 13 P6 1 Hence, Avg Waiting time = $4.5$ and Max waiting time = $13$ Units of time. Deepak Poonia answered Jun 5, 2018 • selected Jun 6, 2018 by Nancy Pareta Deepak Poonia comment Share Follow 0 reply Please log in or register to add a comment.