The purpose of this project is to write a java program that simulates the CPU Scheduler (also known as Short-Term Scheduler) of an operating system.
Budget: $10 – $30 USD
The program implements the following CPU scheduling algorithms.
First-Come-First-Serve (FCFS)
Shortest-Job-First (SJF)
Round-Robin with time slice = 3 (RR-3)
Round-Robin with time slice = 5 (RR-5)
When a process is created, a Process Control Block (PCB) is expected to be created with the following information:
Process ID: Contains the process ID.
Process state: Contains the state of the Process (New, Ready, Running, Waiting, Terminated)
Burst Time (in ms)
Memory Required in MB
The program will read process information from a file (job.txt) - this file will be provided by the instructor.
A sample input file of four jobs is given as follows (Process ID, burst time in ms, memory required in MB):
[Begin of job.txt]
Job1
5, 8, 800
Job2
3, 10, 2000
Job3
8, 3, 4000
Job4
6, 7, 1000
[End of job.txt]
Note: You can assume that
There are no more than 30 jobs in the input file (job.txt).
Processes arrive in the order they are read from the file for fcfs, rr-2 and rr-5.
All jobs arrive at time 0 for sjf.
Main memory is limited to 8192 MB
Compare the average waiting times and the average completion times of all jobs for each scheduling algorithm.
Output the details of each algorithm's execution. You need to show which jobs are selected at what times as well as their starting and stopping burst values. You can choose your display format, but it is recommended that you display the results in terms of a Gantt chart. You have to make sure that processes can only loaded to ready queue only if enough space for the process is available in memory.
First-Come-First-Serve (FCFS)
Shortest-Job-First (SJF)
Round-Robin with time slice = 3 (RR-3)
Round-Robin with time slice = 5 (RR-5)
When a process is created, a Process Control Block (PCB) is expected to be created with the following information:
Process ID: Contains the process ID.
Process state: Contains the state of the Process (New, Ready, Running, Waiting, Terminated)
Burst Time (in ms)
Memory Required in MB
The program will read process information from a file (job.txt) - this file will be provided by the instructor.
A sample input file of four jobs is given as follows (Process ID, burst time in ms, memory required in MB):
[Begin of job.txt]
Job1
5, 8, 800
Job2
3, 10, 2000
Job3
8, 3, 4000
Job4
6, 7, 1000
[End of job.txt]
Note: You can assume that
There are no more than 30 jobs in the input file (job.txt).
Processes arrive in the order they are read from the file for fcfs, rr-2 and rr-5.
All jobs arrive at time 0 for sjf.
Main memory is limited to 8192 MB
Compare the average waiting times and the average completion times of all jobs for each scheduling algorithm.
Output the details of each algorithm's execution. You need to show which jobs are selected at what times as well as their starting and stopping burst values. You can choose your display format, but it is recommended that you display the results in terms of a Gantt chart. You have to make sure that processes can only loaded to ready queue only if enough space for the process is available in memory.