Assume that the system has a multiple level queue with a variable time quantum per queue, and that the incoming job needs 80 ms to run to completion. If the first queue has a time quantum of 5 ms 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? Calculate how much time in ms that it spends in each queue.

Respuesta :

Answer:

a. No. of times Job interrupted = 4

b. Job Finish at Which Queue = 5th

c. Time Spends on each Queue

Queue 1 = 5ms

Queue 2 = 2x 5ms = 10ms

Queue 3 = 2x 10ms = 20ms

Queue 4 = 2x 20ms = 40ms

Queue 5 = 2x 40ms = 80 ms

Explanation:

Given Data:

Total Time Required to complete the job = 80ms

Time Quantum of First Queue = 5ms

To Find

a. No. of times Job interrupted ?

b. Job Finish at Which Queue ?

c. Time Spends on each Queue?

Solution

As Given Data

Queue 1 = 5ms

each Queue has double time Quantum than Previous one so that,

Queue 2 = 2x 5ms = 10ms

Queue 3 = 2x 10ms = 20ms

Queue 4 = 2x 20ms = 40ms

Queue 5 = 2x 40ms = 80 ms

a. The System will interrupt 4 times as there are five queue in the system.

b. As mentioned in Question that 80ms will it take to complete the job so, This task will be completed in 5th Queue.

c. Total Time Spends in each queue is calculated above as

Queue 1 = 5ms

Queue 2 = 2x 5ms = 10ms

Queue 3 = 2x 10ms = 20ms

Queue 4 = 2x 20ms = 40ms

Queue 5 = 2x 40ms = 80 ms