CS FundamentalsHardGATE CS
Processes (arrival, burst): P1 (0, 8), P2 (1, 5), P3 (2, 2), P4 (4, 1), P5 (6, 4), scheduled by SRTF. How many times is a running process preempted (taken off the CPU before it finishes)?
- A. 2
- B. 3
- C. 1
- D. 7
Correct answer: A. 2
Gantt chart: P1 0-1 | P2 1-2 | P3 2-4 | P4 4-5 | P2 5-9 | P5 9-13 | P1 13-20. A preemption happens at each boundary where the outgoing process still has work left: count those, ignoring boundaries where a process simply completed.
More Operating Systems questions
- Under FCFS, a long job L (burst 20) and three short jobs (burst 2 each) are scheduled. Case 1 arrivals: L at 0, S1 at 1, S2 at 1, S3 at 2…
- A 3-level feedback queue: Q0 is RR with quantum 4, Q1 is RR with quantum 8, Q2 is FCFS. New processes enter Q0; a process that uses its…
- Processes (arrival, burst): P1 (0, 3), P2 (1, 5), P3 (2, 2), P4 (4, 4). Which statement about the average waiting time is correct?
- Round Robin is used with quantum q = 10 ms and context-switch time s = 2 ms. All processes are CPU-bound with very long bursts, and the…
- Round Robin with quantum q and context-switch time s is used; every process does exactly one CPU burst of T ms with T < q. What is the CPU…
- Processes (arrival, burst): P1 (0, 5), P2 (1, 3), P3 (3, 6), P4 (4, 2), P5 (10, 4), scheduled by SRTF. During the first 12 ms (time 0 to…