This is an OS simulation that has been implemented by the CPU scheduling algorithms such as:
- First Come, First Serve (FCFS)
- Round Robin (RR)
- Shortest Job First (SJF)
- MultiLevel Feedback Queue (MLFQ) :
- First queue: RR Time Quantum 8 ms
- Second queue: RR with time Quantum 16 ms
- Third queue: FCFS
Input data must be entered through a comma-separated values (.csv) and the columns must be like this:
process_id | arrival_time | cpu_time1 | io_time | cpu_time2 |
---|---|---|---|---|
1 | 1 | 2 | 3 | 4 |
2 | 12 | 3 | 4 | 1 |
3 | 5 | 4 | 5 | 3 |
4 | 13 | 4 | 5 | 15 |
5 | 13 | 5 | 6 | 7 |
you can see and download test file here
- the program will process the processes and will calculate the following information:
- Response Time
- Turnaround Time
- Waiting Time
- Process' Start Time
- Process' End Time
- after running the algorithms for each process these parameters will be shown for the algorithm:
- Total Time and Idle Time
- Average Waiting Time
- Average Response Time
- Average Turnaround Time
- CPU Utilization
- Throughput
example of round robin algorithm's output:
Below is an example of how you can clone and run the project on your local.
- Clone the repo
git clone https://github.com/Amir-Shamsi/cpu-scheduling-algorithm.git
- Install required libraries
pip install -r requirement-libs.txt
- Make a coffee and enjoy! ☕🍪