previous | start | next

First Come First Serve (FCFS)

FCFS - First Come First Serve. The Gantt chart can be used to find the finish times for this non-preemptive scheduling algorithm.

Gantt Chart:
        +------------------------------------+
        |  P1    |   P2      |   P3          |
        +------------------------------------+
        0        4          10              14

        Time     0  1  2  4 
        READY    P1 P2 P2 P2  ...
                       P3 P3
     

From the Gantt chart, finish times are:

Process Finish Wait
P1 4 0
P2 10 3
P3 14 8

So, for example, the wait time for P3 is:

        Wait = Finish - Arrival - CPU_Burst = 14 - 2 - 4 = 8
     

and the average wait time for these three:

        Avg. Wait = (0 + 3 + 8)/3 = 3.667
     


previous | start | next