Question: Instructions: (1) implement Round Robin Scheduling (2) Implement Multi-level feedback queue (3) For each, show cpu utilization when all processes are finished(4) For each, show

Instructions: (1) implement Round Robin Scheduling (2) Implement Multi-level feedback queue (3) For each, show cpu utilization when all processes are finished(4) For each, show average wait time when all processes are finished

the answer like this program i want it in java package scheduler; public abstract class Scheduler implements Iterable { protected int contextSwitchTime; //how long a context switch takes. protected int clock; //the number of cycles since the system was "started" (the current time). public Scheduler(int contextSwitchTime) { this.contextSwitchTime = contextSwitchTime; clock = 0; } public abstract void add(ProcessControlBlock pcb); public abstract ProcessControlBlock next(); public abstract boolean isEmpty(); public abstract void execute(ProcessControlBlock pcb); public void execute() { System.out.println("Executing Processes"); while(!isEmpty() && clock < 100) { updateProcessControlBlocks(); System.out.println("---------Current Processes----------(CLOCK: " + clock + ")"); for(ProcessControlBlock pcb : this) { System.out.println(pcb); } ProcessControlBlock pcb = next(); clock += contextSwitchTime; //a context switch is happening... if(pcb == null) { tick(); continue; } System.out.println(pcb + "@" + clock); execute(pcb); add(pcb); } } public void tick() { clock++; } public void tick(int time) { clock += time; } public void updateProcessControlBlocks() { //System.out.println("Updating Processes (CLOCK: " + clock + ")"); for(ProcessControlBlock pcb : this) { pcb.update(clock); } } }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!