CS FundamentalsVery hardProduct company interview · GATE level
Processes (arrival, burst, priority; a smaller number means higher priority): A (0, 9, 3), B (1, 4, 1), C (3, 6, 4), D (5, 2, 2), E (8, 5, 2). Preemptive priority scheduling is used. What is the average response time (first run minus arrival) and when does C finish?
- A. Average response time 0 ms; C finishes at 26
- B. Average response time 3.4 ms; C finishes at 20
- C. Average response time 3.4 ms; C finishes at 26
- D. Average response time 4.4 ms; C finishes at 26
Correct answer: C. Average response time 3.4 ms; C finishes at 26
A runs 0-1, B (priority 1) preempts and runs 1-5, then D (priority 2, arrived at 5) runs 5-7. A resumes 7-8, E (priority 2) arrives at 8 and preempts A, running 8-13. A finishes 13-20 and C, the lowest priority, runs 20-26. Response times: A 0, B 0, C 20 - 3 = 17, D 0, E 0; average 17/5 = 3.4 ms. Only C ever waits before its first run, and it waits long - the starvation risk of static priorities in miniature.
More Operating Systems questions
- Processes (arrival, burst) in ms: P1 (0, 6), P2 (2, 5), P3 (4, 2), P4 (5, 8), P5 (7, 3). They are scheduled by non-preemptive Highest…
- A multilevel feedback queue has Q0 (Round Robin, quantum 2), Q1 (Round Robin, quantum 4) and Q2 (FCFS). New processes enter Q0. A process…
- Three processes each run CPU burst, I/O burst, CPU burst (in ms): P1 arrives at 0 with 5, 4, 3; P2 arrives at 2 with 3, 6, 2; P3 arrives…
- Reference string: 2, 7, 2, 4, 1, 7, 3, 2, 4, 5, 1, 2, 7, 3, 5, 2. With 4 frames, initially empty, how many page faults do FIFO, LRU and…
- Reference string: 2, 7, 2, 4, 1, 7, 3, 2, 4, 5, 1, 2, 7, 3, 5, 2. Three frames, initially empty, are managed by the clock (second-chance)…
- Reference string: 2, 3, 4, 1, 2, 3, 1, 5, 2, 3, 4, 1, 5. How many page faults does FIFO give with 3 frames and with 4 frames, and LRU with…