GATE / CS ARCHIVE

GATE CSE 1996 / QUESTION 2.20

Completion time under round robin

Operating Systems · CPU Scheduling · Full GATE CSE 1996 paper

GATE 1996, Q2.20 2 marks · MCQ
Report issue

CPU Scheduling

Question 2.20, GATE 1996: At time 0, jobs A,B,C,D arrive in that order with CPU bursts 4,1,8,1. With quantum 1 and no overhead, when does A complete?
Question 2.20, GATE 1996: At time 0, jobs A,B,C,D arrive in that order with CPU bursts 4,1,8,1. With quantum 1 and no overhead, when does A complete?
Tap to enlarge
Your answer
Answer & solution

Answer: D: time 9 (no official key was published)

The first four one-unit slices execute A,B,C,D, ending at time 4. B and D have now finished; A has three units left and C has seven. The next slices are A from 4–5, C from 5–6, A from 6–7, C from 7–8, and A from 8–9. A’s fourth unit therefore finishes at time 9. Counting four slices for A alone would ignore the CPU time given to other ready jobs. The result assumes the stated arrival order determines the initial queue and there is no context-switch cost.

Original paper, page 6