Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Visual Basic Net Database Programming

Authors: Rod Stephens

1st Edition

0789726815, 978-0789726810

More Books

Students also viewed these Databases questions

Question

Do you think physicians should have unions? Why or why not?

Answered: 1 week ago