Simulate and visualize First-Come-First-Serve CPU scheduling algorithm to understand how processes are executed based on their arrival order.
First-Come-First-Serve (FCFS) is the simplest CPU scheduling algorithm. In this scheme, the process that requests the CPU first is allocated the CPU first. FCFS is a non-preemptive algorithm, meaning once a process starts executing, it continues until it completes or is blocked.
Processes arrive at the system at their respective arrival times and are placed in a ready queue.
The process that arrived first is executed first. If two processes have the same arrival time, the tie is broken by process ID or any other predefined criteria.
Once a process starts execution, it continues until completion. After completion, the CPU is assigned to the next process in the queue.
After all processes complete execution, metrics like average waiting time and average turnaround time are calculated to evaluate the scheduler's performance.