This Bash script implements the First-Come, First-Served (FCFS) scheduling algorithm, a simple non-preemptive algorithm where processes are executed in the order they arrive.
-
Ensure you have Bash installed on your system.
-
Clone the repository:
git clone https://github.com/coderzaman/FCFS-First-Come-First-Served-Scheduling-Algorithm.git
-
Navigate to the project directory:
cd fcfs-scheduling
-
Make the script executable:
chmod +x fcfs.sh
-
Run the script:
./fcfs.sh
-
Follow the on-screen prompts to input the number of processes, arrival times, and burst times.
-
Number of Processes (number): The total number of processes in the system.
-
Process Names (p): An array representing process names (e.g., P1, P2).
-
Arrival Times (a): An array representing arrival times for each process.
-
Burst Times (b): An array representing burst times for each process.
Processes are sorted based on their arrival times in ascending order. In case of a tie in arrival times, the original order is preserved.
The script outputs the sorted process names, arrival times, and burst times, along with a detailed table displaying the completion time, turnaround time, and waiting time for each process.
The script calculates and displays average completion time, average waiting time, and average turnaround time for all processes.
This project is licensed under the MIT License - see the LICENSE file for details.
[Aktaruzzaman]
Feel free to contribute, report issues, or provide feedback.
Happy coding! 🚀