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
Consider the following set of processes and the length of CPU burst time given in milliseconds:
Process | CPU Burst time (ms) |
P 1 | 5 |
P 2 | 7 |
P 3 | 6 |
P 4 | 4 |
Assume that processes being scheduled with Round-Robin Scheduling Algorithm with Time Quantum 4ms. Then the waiting time for P 4is _________ ms.
Consider three intensive processes, which requires 10,20 and 30 units of time and arrive at times 0,2 and 6 respectively. how many context switches are needed if the operating system implements a shortest remaining time first scheduling algorithm? Do not count the context switches at time zero and at the end.
Which of the following CPU scheduling algorithms is/are supported by LINUX operating system?
Given CPU time slice of 2 ms and the following list of processes.
Process | Burst time (ms) | Arrival time (ms) |
p 1 | 3 | 0 |
p 2 | 4 | 2 |
p 3 | 5 | 5 |
Find average turnaround time and average waiting time using round-robin CPU scheduling?