Problem Statement:
You will implement a framework for CPU scheduling with three scheduling algorithms: FIFO, round robin, and shortest job first (SJF). Jobs arrive at the CPU scheduler at arbitrary times. When a job arrives, its computation time is known. Assume that all jobs involve only computation, and perform no Input/Output. Jobs thus need to run on the CPU for a total duration equal to their known computation times. When they complete, they leave the system.
Brief descriptions of three algorithms
FIFO
Jobs are processed on a first-in-first-out basis.
Round-robin time-slicing
Pick head of queue, run a job for a time quantum, preempt it, run the next one and so on. A new job goes at the tail of the queue and so does a preempted one. If a new job arrives at the same time as a time quantum completes, the new job goes at the end of the queue.
Shortest Job First - Preemptive version (Shortest Remaining Time First) If there is more than one job, select the one with the shortest execution time. If a new job has shorter REMAINING time, preempt current job and switch to new one.
Solution Specification:
The input to your program will be a file containing job IDs with their arrival times and required computation times.
Input Format
The input command line format should be as follows (where sched is the name of your executable):
sched [-v] -[Rk|S|F]
Where the command-line flag:
- R is round robin, k is an integer specifying the time-slice
- S is shortest job first
- F is FIFO
- The -v option indicates a verbose output mode (i.e. more information is displayed)
- is the name of the input file whose format is described below
You should submit a write-up as well as your program. Your write-up should include any known bugs, limitations, and assumptions in your program. This wirte-up should be in text-format and titled as ‘README'. It should be submitted along with your code. TA will use the ‘README' file to compile (or install) and run your program. If the TA has trouble with your program then he will contact you to makeup it.