Consider the following arrival and burst times for three processes P0, P1, P2. The pre-emptive shortest job first algorithm is used, and scheduling is carried out only at the arrival or completion of a process. What is the average waiting time for the three processes?
| Process | Arrival time | Burst time |
|---|---|---|
| P0 | 0 ms | 7 |
| P1 | 1 ms | 3 |
| P2 | 2 ms | 7 |
Pick an option to check yourself, or open the answer below.
Show answer & explanation
Correct answer: B. 3.67 ms
Explanation
P0 runs 0–1 (6 left). P1 arrives with 3 and preempts it, running 1–4 (at 2, P2's 7 is longer). At 4, P0 (6) beats P2 (7): P0 runs 4–10, then P2 10–17. Waiting: P0 = 10 − 7 = 3, P1 = 0, P2 = 17 − 2 − 7 = 8. Average = 11/3 ≈ 3.67 ms.More System Software and Operating System questions
- Match List I with List IIList I List II A. RAID level 2 I. Bit interleaved parity B. RAID level 4 II. Block interleaved distributed parity…
- Match List I with List IIList I List II A. Critical region I. Hoare's monitor B. Wait/signal II. Mutual exclusion C. Working set III. Princ…
- At a particular time of computation, the value of a counting semaphore is 7. Then 20 P operations and x V operations were completed on this…
- Requests to access cylinders occur in the sequence 4, 34, 10, 7, 19, 73, 2, 15, 6, 20. The head is currently at cylinder 50, and it takes 1…
- Consider now that T is stored in column-major format. What is the main memory hit ratio?
- Consider that T is stored in column-major format. How many page faults will be encountered?