Go Back

A Quick Abstract:

1. Definition:

FCFS is a simple CPU scheduling algorithm where processes are executed in the order they arrive in the ready queue.

2. Process Arrival and Ready Queue:

Arrival of Processes:

Processes are added to the ready queue as they arrive.

The ready queue maintains the chronological order of process entry.

3. Execution and Process Selection:

Execution:

The CPU executes the process at the front of the ready queue.

The selected process runs until it completes its CPU burst or is blocked by an I/O operation.

Completion or Blocking:

Upon completion or blocking, the next process in the ready queue is selected for execution.

4. Waiting Time and Turnaround Time:

Waiting Time:

Waiting time is the total time a process spends in the ready queue before obtaining CPU time.

Turnaround Time:

Turnaround time is the overall time taken by a process from submission to completion.

5. Pros and Cons:

Pros:

FCFS is simple and easy to understand.

It avoids starvation, ensuring every process eventually gets CPU time.

Cons:

The "convoy effect" may occur, where shorter processes are delayed behind longer ones.

6. Starvation:

While FCFS prevents starvation, it lacks prioritization based on process characteristics. Long processes can dominate the CPU, causing shorter processes to wait.

7. Example Scenario:

Consider three processes, A, B, and C, arriving in that order. If A starts execution first, B and C will have to wait until A completes.

8. Conclusion:

In conclusion, FCFS is a foundational scheduling algorithm, offering simplicity and fairness. However, its straightforward nature may not always be optimal for minimizing waiting times or maximizing system throughput.

Notes From The Slides:

First- Come, First-Served (FCFS) Scheduling

                                    Process         Burst Time               

                                     P1                       24

                                     P2                       3

                                     P3                        3

Suppose that the processes arrive in the order: P1 , P2 , P3

The Gantt Chart for the schedule is:

 

Suppose that the processes arrive in the order:

                                     P2 , P3 , P1

           Consider one CPU-bound and many I/O-bound processes