142k views
3 votes
4. Assume a multiple level queue system with a variable time quantum per queue, and that the incoming job needs 50ms to run to completion. If the first queue has a time quantum of 5ms and each queue thereafter has a time quantum that is twice as large as the previous one, how many times will the job be interrupted, and on which queue will it finish its execution? Explain how much time it spends in each queue.

User Gang Liang
by
3.3k points

1 Answer

3 votes

Answer:

Step-by-step explanation:

For the completion of incoming job it will take 50ms

First queue takes 5ms quantum time and the subsequent queue takes double of the previous question

So,

First queue T_1 = 5ms

Second queue T_2 = 2 × T_1 = 2 × 5 = 10ms

Third queue T_3 = 2 × T_2 = 2 × 10 = 20ms

Fourth queue T_4 = 2 × T_3 = 2 × 20 = 40ms

Fifth queue T_5= 2 × T_4 = 2 × 40 = 80ms.

Now, the job will be done after the fifth queue.

So, after the first queue, the job is not completed, so, we have first interruption

After the second queue, the job is not completed, so, we have second interruption

After the third queue, the job is not completed, so we have third interruption.

After the fourth queue, the job is not yet completed, so we have the fourth interruption

And in the fifth queue the job is completed, so we don't have any interruption here.

So, the job will be interrupted 4 times and it will finished on the fifth queue.

User Nitha Paul
by
3.6k points