App-specific teaching variant
SRTF at Execution Checkpoints
This teaching variant uses the shortest-remaining-work rule at selected decision points instead of reconsidering immediately on every arrival. Arrivals join Ready as soon as they occur, but they do not interrupt before the current execution checkpoint. Completion also creates a decision point.
The rule in this application
The check interval counts CPU execution from the current dispatch or previous check. Waiting and dispatch overhead do not spend that interval. This is an application variant for studying delayed scheduling decisions. It is not a separate standard algorithm, and its results differ from continuous SRTF.
Worked example: check interval 3
| Process | Arrival | Burst |
|---|---|---|
| P1 | 0 | 7 |
| P2 | 1 | 3 |
| P3 | 2 | 1 |
One CPU · One burst per process · No I/O · Dispatch cost 0 · Check interval 3. Times are abstract units.
Arrivals join Ready, but selection waits until an execution checkpoint or completion. At the first checkpoint, 3, P1 has 4, P2 has 3, P3 has 1 units left. P3 is selected.
P1 later runs from 7 to its next checkpoint at 10: 3 units of actual CPU service. Checkpoints are relative to execution, not a global time grid. The full trace is P1 [0, 3), P3 [3, 4), P2 [4, 7), P1 [7, 11).
Arrivals join Ready, but selection waits until an execution checkpoint or completion. At the first checkpoint, 3, P1 has 4, P2 has 3, P3 has 1 units left. P3 is selected.
P1 later runs from 7 to its next checkpoint at 10: 3 units of actual CPU service. Checkpoints are relative to execution, not a global time grid. The full trace is P1 [0, 3), P3 [3, 4), P2 [4, 7), P1 [7, 11).
- P1: [0, 3)
- P3: [3, 4)
- P2: [4, 7)
- P1: [7, 11)
Checkpoints at 3, 10. Same-owner continuation at 10.
Calculate the result
| Process | Completion | Waiting | Turnaround | Response |
|---|---|---|---|---|
| P1 | 11 | 4 | 11 | 0 |
| P2 | 7 | 3 | 6 | 3 |
| P3 | 4 | 1 | 2 | 1 |
P2: turnaround = 7 − 1 = 6. Waiting = 6 − 3 = 3. First response = 4 − 1 = 3.
P2 and P3 first start at 4 and 3 here, versus 1 and 2 with continuous SRTF. These differences show the effect of postponing a decision.
Mean waiting = (4 + 3 + 1) / 3 ≈ 2.667 units. Mean response ≈ 1.333 units.
Check interval and quantum serve different purposes
A checkpoint asks which eligible process has the least remaining work. Round Robin instead gives the next FIFO process a turn. Reaching a checkpoint does not move the current process to the back of a FIFO rotation.
The app models configured dispatch overhead, not an extra computational cost for every comparison or checkpoint.