This project simulates process scheduling using two algorithms: First-Come-First-Serve (FCFS) and Priority Scheduling.
- C compiler (e.g., GCC)
- Make (optional but recommended)
If using Make:
make
gcc -c fcfs.c -o fcfs.o
gcc -c priority.c -o priority.o
gcc -c test.c -o test.o
gcc fcfs.o priority.o test.o -o test
./test
- To customize the number of processes and their attributes (burst time, priority), you can modify the main function in test.c.
int n = 5; // You can change this to the desired number of processes
Process processes[n];
for (int i = 0; i < n; i++) {
processes[i].pid = i + 1;
processes[i].burst_time = rand() % 1000 + 1; // Random burst time between 1 and 1000
processes[i].priority = rand() % 10 + 1; // Random priority between 1 and 10
}
- Feel free to customize the number of processes and adjust the range for burst time and priority.
- This project is licensed under the MIT License - see the LICENSE file for details.