FCFS Scheduling Visualizer

Simulate and visualize First-Come-First-Serve CPU scheduling algorithm to understand how processes are executed based on their arrival order.

Configuration

What is FCFS Scheduling?

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.

Key Concepts

  • Arrival Time: Time at which a process enters the ready queue.
  • Burst Time: Time required by a process for CPU execution.
  • Completion Time: Time at which a process completes execution.
  • Turnaround Time: Time taken from submission to completion (Completion Time - Arrival Time).
  • Waiting Time: Time a process waits in the ready queue (Turnaround Time - Burst Time).

How the Algorithm Works

1. Process Arrival

Processes arrive at the system at their respective arrival times and are placed in a ready queue.

2. Execution Order

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.

3. Process Completion

Once a process starts execution, it continues until completion. After completion, the CPU is assigned to the next process in the queue.

4. Performance Metrics

After all processes complete execution, metrics like average waiting time and average turnaround time are calculated to evaluate the scheduler's performance.

Advantages & Limitations

Advantages

  • ✓ Simple and easy to understand
  • ✓ Easy to implement
  • ✓ Fair for processes with same priority

Limitations

  • ✗ Can lead to "Convoy Effect" (short processes waiting behind long ones)
  • ✗ Poor for interactive systems due to potentially high waiting times
  • ✗ Average waiting time can be high compared to other algorithms