Simulating CPU Scheduling
Posted on 2003-12-04
I am attempting to write a program that simulates the First Come First Serve, Shortest Job Next, and Shortest Remaining Time scheduling algorithms. For each algorithm I want to print, in the order of completion, the finishing time, wait time, and turnaround time for each process. I am also going to display the average waiting and turnaround times for each algorithm.
The number of processes, arrival time, and CPU time is gathered from the user. The arrival time and CPU time is stored into a two dimensional array.
I have the FCFS algorithm coded and working, but am having problems figuring out an algorithm for the SRT and SJN. Any help would be appreciated.