7
Consider the processes given below:
What is the waiting time of process P3 using shortest job first (pre-emptive)?
| Process | Arrival Time | Service Time (Burst) |
|---|---|---|
| P1 | 0.001 | 8 |
| P2 | 4.001 | 6 |
| P3 | 14.001 | 4 |
| P4 | 16.001 | 2 |
EXPLANATION
Bio-Programming
- Shortest Remaining Time First (SRTF / Preemptive SJF) Execution Trace:
- Timeline Analysis:
- Time ~0.001: P1 arrives with burst 8. P1 starts execution.
- Time ~4.001: P2 arrives with burst 6. Remaining time for P1 is $8 - 4 = 4$. Since $4 \lt 6$, P1 is not preempted and continues executing.
- Time ~8.001: P1 finishes execution. Only P2 is in the ready queue with burst 6. P2 begins execution.
- Time ~14.001: P2 finishes execution ($8.001 + 6 = 14.001$). Exactly at this time, P3 arrives with burst 4. Since the CPU is free, P3 is dispatched immediately at time 14.001!
- Time ~16.001: P4 arrives with burst 2. At this point, P3 has executed for 2 units, leaving a remaining burst of $4 - 2 = 2$. By standard tie-breaker (non-preemption on equal remaining burst), P3 continues and completes at time 18.001.
- Waiting Time Calculation for P3:
- Conclusion: The waiting time of process P3 is 0 (Option 4).
Correct option: (4) Option 4
Explanation not matching this question?
क्या व्याख्या इस प्रश्न से मेल नहीं खा रही?
Report
Want to practice this paper in exam conditions?
क्या आप परीक्षा जैसे माहौल में अभ्यास करना चाहते हैं?
Test yourself in 5-question batch format with timer and hidden answers.
5-प्रश्नों के बैच फॉर्मैट, टाइमर और छिपे उत्तरों के साथ खुद को परखें।
Start Practice Mode →
प्रैक्टिस टेस्ट मोड शुरू करें →