The above Round Robin policy does not care about the process priority. In your homework, we will update our previous emulator to support preemptive Priotity algorithms.

35 0

Get full Expert solution in seconds

$1.97 ONLY

Unlock Answer

The above Round Robin policy does not care about the process priority. In your homework, we will update our previous emulator to support preemptive Priotity algorithms.
To achieve this goal, you have to complete these requirements:
1. Include an additional priority field as the third column in the input.txt as
described below.
2 4
0 7 1
2 4 2
4 1 2
5 4 1
2. Update the process struct definition
3. Change the original Round-Robin algorithm to the Preemptive Priority. When a
process is pushed back to the ready_queue, its priority will be decreased by 1 if
the priority is larger than 0.
Your work must also include your own implementation of the in class coding exercise
requirements.

EXPERT ANSWER

It then creates a ready queue with capacity equal to the number of processes in the input file. When a process is enqueued, the priority field is updated if it is larger than 0 and the size of the queue is incremented. When a process is dequeued, the burst time is checked to see if it is larger than the time quantum. If it is, the process is pushed back to the queue with its priority decreased by 1.