First Come First Served Algorithm
First come first served scheduling algorithm (FCFS)
FCFS also termed as First-In-First-Out i.e. allocate the CPU in order in which the process arrive. When the CPU is free, it is allowed to process, which is occupying the front of the queue. Once this process goes into running state, its PCB is removed from the queue. This algorithm is non-preemptive.
- Suitable for batch system.
- It is simple to understand and code.
- Waiting time can be large if short request wait behind the long process.
- It is not suitable for time sharing system where it is important that each user should get the CPU for equal amount of time interval.
Consider the following set of processes having their CPU-burst time. CPU burst time indicates that for how much time, the process needs the CPU.
|process||Time for which cpu is required|
|CPU burst time|
If the processes have arrived in order P1, P2, P3 then the average waiting time for process will be obtained from Gantt chart.
Waiting Time for P1 = 0 Millisecond
Waiting Time for P2 = 10 Millisecond
Waiting Time for P2 = 15 Millisecond
Average Waiting Time = (0+10+15)/2 = 8.33 Millisecond
If the process arrive in order P2, P3, P1 then
Average Waiting Time = (0+5+10) / 3 = 5 Millisecond
Thus average waiting time will always depends upon the order in which the processes arrive. And vary depending upon whether the processes having less CPU-burst arrive first in the ready queue. Therefore this algorithm is never recommended whenever performance is major issue.
- Process States As the program executes, it generally changes state. A state...
- Processes Scheduling queue As processes enter the system they put in job queue....
- Dekker’s Algorithm Dekker’s Algorithm Dijktra reported on algorithm for mutual exclusion for...
- processes creation A process can create several new processes. The creating process...
- process model The software and large program is organized into a number...