FCFS First Come First Serve - CPU Scheduling
FCFS (First Come First Served)
CPU SCHEDULING
1. AIM
To input a list of processes with their arrival times and burst times, simulate the FCFS CPU Scheduling Algorithm, and compute:
-
Completion Time
-
Turnaround Time
-
Waiting Time
-
Average Waiting Time
2. THEORY
CPU Scheduling
CPU scheduling determines the order of execution of processes in a ready queue.
FCFS Scheduling (Non-Preemptive)
-
FCFS executes processes in the order of arrival.
-
The process that comes first gets the CPU first.
-
It is simple but suffers from convoy effect.
Important Performance Metrics
-
Completion Time (CT)
Time at which a process finishes execution. -
Turnaround Time (TAT)
-
Waiting Time (WT)
3. ALGORITHM
-
Input the number of processes n.
-
Input each process's:
-
Process ID
-
Arrival Time
-
Burst Time
-
-
Sort processes in ascending order of arrival time.
-
For each process:
-
If CPU is idle, start at arrival time
-
Compute Completion Time
-
Compute Turnaround Time
-
Compute Waiting Time
-
-
Compute average waiting time.
-
Display the scheduling table.
4. PROGRAM (C Program for FCFS Scheduling)
5. SAMPLE OUTPUT
Input:
Output:
6. RESULT
FCFS scheduling was successfully simulated.
The program computed:
-
Completion time
-
Turnaround time
-
Waiting time
-
Average waiting time
for all processes based on their arrival and burst times.
Comments
Post a Comment