FCFS SchedulingWith Advantages And Drwaback

Explain  First-Come, First-Served (FCFS) Scheduling, Explain FCFS  SchedulingWith Advantages And Drwaback

In This Topic & Blog Having Any Query Then Post your Comment and Suggestion Below

First-Come, First-Served (FCFS)

Scheduling

• It is the simplest CPU scheduling algorithm. The
criteria of this algorithm is ‘the process that
requests the CPU first is holds the CPU first’ or
which process enter the ready queue first is served
first’. The operating system maintains a data
structure, that is a ready queue, which process is
the head of the ready queue, connect the CPU to
that process.
• Burst time is the time, required the CPU to
execute that job, generally it is in milliseconds.

Suppose that the processes arrive in the order
P2 , P3 , P1 .
• The Gantt chart for the schedule is:
• Waiting time for P1 = 6; P2 = 0; P3 = 3
• Average waiting time: (6 + 0 + 3)/3 = 3
• Much better than previous case.
• Convoy effect short process behind long process

• First-Come, First-Served (FCFS)
– Also “First In, First Out” (FIFO) or “Run until done”
• In early systems, FCFS meant one program
scheduled until done (including I/O)
• Now, means keep CPU until thread blocks
• Example: Process Burst Time
P1 24
P2 3
P3 3
– Suppose processes arrive in the order: P1 , P2 , P3 The Gantt Chart for the schedule is:
– Waiting time for P1 = 0; P2 = 24; P3 = 27
– Average waiting time: (0 + 24 + 27)/3 = 17
– Average Completion time: (24 + 27 + 30)/3 = 27
• Convoy effect: short process behind long process

• Example continued:
– Suppose that processes arrive in order: P2 , P3 , P1 Now, the Gantt chart for the schedule is:
– Waiting time for P1 = 6; P2 = 0; P3 = 3
– Average waiting time: (6 + 0 + 3)/3 = 3
– Average Completion time: (3 + 6 + 30)/3 = 13
• In second case:
– average waiting time is much better (before it was 17)
– Average completion time is better (before it was 27)
• FIFO Pros and Cons:
– Simple (+)
– Short jobs get stuck behind long ones (-)
• Safeway: Getting milk, always stuck behind cart full of small items. Upside:
get to read about space aliens!

• Advantage Of FCFS:
• Easy to implement.
• It is very simple.
• Drawback
Of FCFS:
• Trouble some for time sharing systems.
• The average waiting time is very high, this may
impact on the performance of the CPU.

Labels: