First Come First Serve (FCFS) Scheduling Algorithm
What is FCFS?
FCFS is a non-preemptive scheduling algorithm that executes processes in the order they arrive in the ready queue.
How FCFS Works
- Processes are added to the ready queue in the order they arrive.
- The process at the front of the queue is executed first.
- The process runs until it completes or is blocked.
- The next process in the queue is then executed.
Advantages
- Simple to implement.
- Easy to understand.
- No starvation, as every process gets a chance to execute.
Disadvantages
- Not efficient for processes with varying burst times.
- Can lead to long waiting times for processes that arrive later.
- Not suitable for interactive systems.
Example
Process | Arrival Time | Burst Time |
---|---|---|
P1 | 0 | 5 |
P2 | 1 | 3 |
P3 | 2 | 2 |
Gantt Chart
P1 (0-5), P2 (5-8), P3 (8-10)
No comments:
Post a Comment