0
votes

Hello I'm undergraduate student of computer programming

I take operating system class and I have question about MLFQ scheduling

Suppose that MLFQ has two ready queues, and they use both round-robin scheduling method which of time quantum is 3 seconds and 5 seconds each

Of course priority of Q1 is higher.

Then suppose that there are no ready process in Q1, so process in Q2 can be allocated on CPU.

However, a process that finished IO bound burst returns to Q1, and process in CPU which belonged to Q2 is not done(just 3 seconds gone)

In this situation, What happen?

Is the process in Q1 preempt the CPU right now?

Or process in CPU now(which is come from Q2) is allocated on CPU until time quantum of it(still 2 seconds needed) is reached?

Thank you for reading.

1

1 Answers

0
votes

The process that arrives after completing I/O burst in Q1, will preempte the process in Q2. Quoting from the Operating Systems principles by Galvin,Gagne and Silberchatz:

A process that arrives in Q1, will preempt a process in Q2. A process in Q1 will in turn be preempted by a process arriving in Q0(if Q0 exists).

SO,Any process that arrives in a higher priority Q, will preempt the process of a lower priority Q, even if the time quantum of lower process is not reached. A process gets to have the CPU as long as the ready Q of higher priority is empty.