Question: Process scheduling algorithms You are about to write a program that performs runs of the following process scheduling algorithms using C or C++ programming languages.
Process scheduling algorithms
You are about to write a program that performs runs of the following process scheduling algorithms using C or C++ programming languages.
First-come first-served (FCFS)
Shortest job first (SJF)
Generate a set of simulated processes. Each simulated process is simply a small data structure that stores information about the process that it represents.
For each process, randomly generate:
An arrival time
An burst time
Assume only one CPU and one ready queue. Sort the simulated processes so that they enter the queue in arrival time order. For this assignment, only consider CPU time for each process (no I/O wait times).
Each simulation run should last until the completion of the last process. Run each algorithm 2 times to get averages for the statistics below.
Outputs for each algorithm run (total 4 runs)
Create 5 processes only.
Each created processs name (such as A, B, C, D, E), arrival time, burst time
Calculated statistics for the processes for the run:
Average waiting time for each run
Average turnaround time for each run
Calculated statistic for the algorithm for the run:
Throughput for FCFS
Throughput for SJF
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
