Consider the following 3 processes with the length of the CPU burst time given in milliseconds : What is the average waiting time for these processes if they are scheduled using preemptive shortest job first scheduling algorithm?Process Arrival Time Burst Time P1 0 8 P2 1 4 P3 2 9
4.67
Consider the following processes with their Arrival Time (AT) and Burst Time (BT):
| Process | Arrival Time (ms) | Burst Time (ms) |
|---|---|---|
| P1 | 0 | 8 |
| P2 | 1 | 4 |
| P3 | 2 | 9 |
Scheduling Algorithm Used: Preemptive Shortest Job First (SJF) (also known as Shortest Remaining Time First – SRTF)
Time 0 – 1: Only P1 is available, so P1 starts execution. Remaining time of P1 = 7 ms
Time 1: P2 arrives with burst time 4 ms, which is less than P1’s remaining time. So, P1 is preempted and P2 starts execution.
Time 1 – 5: P2 continues execution and completes at time 5.
Time 5: P1 (7 ms remaining) and P3 (9 ms) are available. P1 has the shortest remaining time, so P1 executes.
Time 5 – 12: P1 completes execution at time 12.
Time 12 – 21: Only P3 remains, so P3 executes and completes at time 21.
| Process | Completion Time (CT) |
|---|---|
| P1 | 12 |
| P2 | 5 |
| P3 | 21 |
Formula used:
Waiting Time (WT) = Completion Time − Arrival Time − Burst Time
Average Waiting Time =
(4 + 0 + 10) / 3 = 14 / 3 = 4.67 ms
The average waiting time using preemptive SJF scheduling is 4.67 milliseconds.
Consider the following four processes with the arrival time and length of CPU burst given in milliseconds :
| Process | Arrival Time | Burst Time |
| P 1 | 0 | 8 |
| P 2 | 1 | 4 |
| P 3 | 2 | 9 |
| P 4 | 3 | 5 |
The average waiting time for preemptive SJF scheduling algorithm is
Which of the following is not a CPU scheduling Algorithm?
Which of the following statement(s) is/are true about CPU scheduling algorithm?
I. Shortest remaining time first scheduling may cause starvation
II. Round Robin is better than First Come First Serve in terms of response time
A process residing in main memory and ready and waiting for execution, is kept on
In which of the following scheduling criteria, context switching will never take place?