A basic CLI simulator for cpu scheduling algorithms written in C
. This simulator will help you to visualize Gantt Chart
along with process information. Tried to make it as beginner friendly as possible both for the user and developer. The algorithms are implemented like the method we use while doing these by pen and paper.
- FCFS [First Come First Serve]
- RR [Round Robin]
- SJF [Shortest Job First]
- SRTF [Shortest Remaining Time First]
- NPP [Non Preemptive Priority]
- PP [Preemptive Priority]
.
├── algos
│ ├── algos.h
│ ├── fcfs.c
│ ├── functions.c
│ ├── npp.c
│ ├── rr.c
│ ├── sjf.c
│ └── srtf.c
├── compile.sh
├── LICENSE
├── main.c
├── process.txt
├── README.md
└── utils
├── colors.h
├── cqueue.c
├── gantt.c
├── input.c
├── process.c
├── sort.c
├── table.c
└── utils.h
git clone https://github.com/eniac00/cpu_scheduling_cli
cd cpu_scheduling_cli
chmod +x compile.sh
./compile.sh
./cpu <algorithm> <text_file_containing_process_info>
For non-priority based scheduling
2 ------> total process
P1 0 5
P2 3 8
| | |
| | ┕--------> burst time
| ┕----------> arrival time
┕-------------> process name or ID
----------------------------------------------------------------------
For priority based scheduling
2 ------> total process
P1 0 5 2
P2 3 8 1
| | | |
| | | ┕------> priority
| | ┕--------> burst time
| ┕----------> arrival time
┕-------------> process name or ID