Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider a CPU that has to run a bunch of jobs. You are asked to develop a scheduler for the CPU. Your program should run

Consider a CPU that has to run a bunch of jobs. You are asked to develop a scheduler for the CPU. Your program should run in a loop, each iteration of which corresponds to a time slice for the CPU. Each job is assigned a priority, which is an integer between 20 (highest priority) and 19 (lowest priority), inclusive. From among all jobs waiting to be processed in a time slice, the CPU must work on a job with highest priority. In this simulation, each job will also come with a length value, which is an integer between 1 and 100, inclusive, indicating the number of time slices that are needed to process this job. For simplicity, you may assume jobs cannot be interruptedonce it is scheduled on the CPU, a job runs for a number of time slices equal to its length. Moreover, each time a job has spent x time slices in the waiting line its priority is increased by 1. Notice that after the priority of a job is increased its waiting time restarts from 0. Your simulator must output the name of the job running on the CPU in each time slice and must process a sequence of commands, one per time slice, each of which is of the form add job name with length n and priority p or no new job this slice.

I want program in Python.

I want program in Python. urgent

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

Seven NoSQL Databases In A Week Get Up And Running With The Fundamentals And Functionalities Of Seven Of The Most Popular NoSQL Databases

Authors: Aaron Ploetz ,Devram Kandhare ,Sudarshan Kadambi ,Xun Wu

1st Edition

1787288862, 978-1787288867

More Books

Students also viewed these Databases questions