Question: Write a program that Implements a CPU scheduler simulation that uses the Priority preemptive Scheduling Algorithm using C++ for example A job can be defined
Write a program that Implements a CPU scheduler simulation that uses the Priority preemptive Scheduling Algorithm using C++ for example A job can be defined by an arrival time and a burst time. For example, heres a sequence of jobs: <0, 100>, <2, 55>, <2, 45>, <5, 10> The first job arrives at time 0 and requires 100ms of CPU time to complete; the second job arrives at time 2 and requires 55ms of CPU time; the third job arrives at time 2 and requires 45ms; and so on. Your simulator should first generate a sequence of jobs. The burst lengths can be determined by selecting a random number . Your program should simulate the arrival of jobs for up to n milliseconds and then stop. Once the jobs have been generated using arrival time and burst time your program should measure at least (1) the CPU utilization, (2) the waiting time , and (3) the job turnaround time.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
