Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

implement MLFQ using C++ please using linked list do not ask for user input will

ID: 3607350 • Letter: I

Question

implement MLFQ using C++ please using linked list

do not ask for user input

will compute the overall wait times, response times, and turnaround times for each process and averages for MLFQ


P1 {4,24,5,73,3,31,5,27,4,33,6,43,4,64,5,19,2}

P2 {18,31,19,35,11,42,18,43,19,47,18,43,17,51,19,32,10}

P3 {6,18,4,21,7,19,4,16,5,29,7,21,8,22,6,24,5}

P4 {17,42,19,55,20,54,17,52,15,67,12,72,15,66,14}

P5 {5,81,4,82,5,71,3,61,5,62,4,51,3,77,4,61,3,42,5}

P6 {10,35,12,41,14,33,11,32,15,41,13,29,11}

P7 {21,51,23,53,24,61,22,31,21,43,20}

P8 {11,52,14,42,15,31,17,21,16,43,12,31,13,32,15}

the processes follow {CPU, IO, CPU, IO, ...}

output should look like this


Now Running: P1
Ready Queue: Process Burst
P2 18
P3 6
P4 17
P5 5
P6 10
P7 21
P8 11

Now In I/O: Process Remaining time
[empty]

Current Time: 4

Now running: P2

Ready queue: Process Burst
P3 6
P4 17
P5 5
P6 10
P7 21
P8 11

Now in I/O: Process Remaining time
P1 24

Explanation / Answer

Multilevel Feedback Queue Scheduling Algorithm

The multilevel feedback queue is a method of kernel scheduling that attempts to resolve the problems associated with First-Come-First-Serve (FCFS) scheduling and Shortest-Job-First (SJF) scheduling, namely inefficient turnaround times for interactive and real-time processes and job starvation respectively.

Multilevel feedback queue (MLFQ) scheduling uses a system of queues, each designated a different priority. Each queue is assigned a different quantum time for Round-Robin (RR) scheduling. The important thing to note about MLFQ scheduling is that it is preemptive: a currently running process can be removed from the CPU if another process is deemed to be of higher priority. At each cycle of the CPU, processes can be moved between queues, and therefore the priority of a process can be considered dynamic.

This implementation in Python is a simple demonstration of Multilevel Feedback Queue Scheduling, and is by no means a directly translatable implementation to an operating system's kernel. There are 256 different priorities, and therefore 256 queues in this sample system.

Transitions to consider

New process: goes to first priority queue Q0

Process leaves voluntarily (process yields or blocks for I/O): process leaves system and is inserted back in the same queue when it returns

Process takes up quantum time at Q[X]: bump down to the next priority queue Q[X+1]

Process blocks for I/O at Q[X]: bump up to a higher priority queue Q[X-1] to allow escape from lowest priority level (prevents starving)

Procedure:

Move processes to their positions

pick first process in topmost queue

*** Given current process currProc and list of queues queues: ***

First step:

Second step:

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at drjack9650@gmail.com
Chat Now And Get Quote