Answered step by step
Verified Expert Solution
Question
1 Approved Answer
the program has to be written in C and give the schedule as shown in the example To properly implement priority you also need pre-emption
the program has to be written in C and give the schedule as shown in the example
To properly implement priority you also need pre-emption - the concept of periodically stopping a job to take away the CPU and decide who is the next eligible process to run. This is needed to prevent long unimportant jobs that acquire the CPU and start computing to only hold the CPU while new short important jobs arrive and have to wait. To implement pre-emption, you only execute a job for 1 period and then you add it back into the run list. For example if we have 1 CPU Duration Priority im Mary Sue Mary This would result in: Time 10 12 13 14 15 16 17 IDLE Summary Mary Sue 17 Write a C program that will read in job requests and print out the corresponding job schedule according to a priority algorithm as above. The input format is each line entry contains a job separated by a tab. The first line of input is ignored as the header. The output format is two tables. First table is the running time and the job currently executing (tab separated). The second table is a summary with the user name (in the order in which jobs arrive) and the time when their last job is completed. Note that when we order priorities, the lower the number, the higher the priority. For this assignment you can assume that priorities are whole numbers from 1- 10 where 1 is the highest priority and 10 is the lowest. NOTE: THE INPUT AND OUTPUT OF YOUR PROGRAM IS SPECIFIED SUCH THAT THE MARKER CAN AUTO TEST YOUR SUBMISSIONS. PLEASE FOLLOW THE SPECIFICATIONS! INPUT WILL BE READ VIA stdin (EG. KEYBOARD). OUTPUT SHOULD BE PRINTED TO stdout (EG. MONITOR)Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started