This C program calculates the waiting times (Tw) and turnaround times (Tr) for three scheduling algorithms: FCFS (First-Come, First-Served), SJF (Shortest Job First), and RR (Round Robin).
- FCFS: Calculates waiting and turnaround times using the FCFS scheduling algorithm.
- SJF: Calculates waiting and turnaround times using the SJF scheduling algorithm.
- RR: Not currently implemented in the provided code, but intended for the Round Robin scheduling algorithm.
To compile the program, use the make
command:
make
This will generate an executable called my_program.
To run the program, use the make run command:
make run
The program will prompt you to input the number of processes and their arrival times (Ti) and burst times (Di). Additionally, for the RR algorithm, it will ask for the quantum time.
main.c: Contains the main code for calculating waiting and turnaround times, and handling input and output. Cleanup To clean up the files generated by compilation, use:
make clean
This will remove the main
executable.
Notes Make sure you have gcc installed on your system to compile the program. The code is designed to run on Unix-like systems.
Davide Usberti ([email protected])