Video summary
L-2.3: First Come First Serve(FCFS) CPU Scheduling Algorithm with Example
Main summary
Key takeaways
Main ideas / lessons (FCFS CPU Scheduling)
- FCFS (First Come First Serve) schedules CPU tasks based on arrival time:
- The process that arrives first gets the CPU first.
- FCFS here is non-preemptive:
- Once the CPU starts a process, it runs to completion without interruption.
- Only after it finishes does the scheduler choose the next process.
- A Gantt chart is used to visualize the timeline and compute:
- Completion time
- Turnaround time
- Waiting time
- Response time
Numerical example walkthrough (from the subtitles)
Given processes
- Processes: P1, P2, P3, P4
- Arrival times (AT):
- P1 arrives at 0
- P2 arrives at 1
- P3 arrives at 5
- P4 arrives at 6
- Burst times (BT) / execution times:
- P1 = 2
- P2 = 2
- P3 = 3
- P4 = 4
Gantt chart execution logic
- Time 0 to 2
- At time 0, only P1 has arrived → CPU runs P1 for 2 units
- P1 completes at 2
- Time 2 to 4
- At time 2, P2 has already arrived and is waiting → run P2 for 2 units
- P2 completes at 4
- Time 4 to 5 (CPU idle)
- Next arrivals are:
- P3 at 5
- P4 at 6
- No process available between 4 and 5 → CPU is idle
- Next arrivals are:
- Time 5 to 8
- At time 5, run P3 for 3 units
- P3 completes at 8
- Time 8 to 12
- At time 6, P4 arrived earlier, but it waits until the CPU is free
- Run P4 for 4 units
- P4 completes at 12
Completion time (CT)
- CT values:
- P1: 2
- P2: 4
- P3: 8
- P4: 12
Time calculations (instructions / formulas)
1) Turnaround Time (TAT)
- Formula:
TAT = CT − AT - Calculations:
- P1:
2 − 0 = 2 - P2:
4 − 1 = 3 - P3:
8 − 5 = 3 - P4:
12 − 6 = 6
- P1:
2) Waiting Time (WT)
-
Formula relationship: Waiting time = Turnaround time − Burst time
WT = TAT − BT -
Calculations:
- P1:
2 − 2 = 0 - P2:
3 − 2 = 1 - P3:
3 − 3 = 0 - P4:
6 − 4 = 2
- P1:
3) Response Time (RT)
-
Formula described:
Response time = (time when CPU first starts the process) − arrival time -
Computed first-CPU start times (from the Gantt chart):
- P1 first runs at 0 →
0 − 0 = 0 - P2 first runs at 2 →
2 − 1 = 1 - P3 first runs at 5 →
5 − 5 = 0 - P4 first runs at 8 →
8 − 6 = 2
- P1 first runs at 0 →
- Key note stated:
- In non-preemptive FCFS, response time ends up equivalent to waiting time, so response time is not especially emphasized (more relevant in preemptive/round-robin cases).
4) Average Turnaround Time
- Formula: average TAT =
(sum of TAT) / number of processes - Subtitles indicate:
- Total TAT = 14
- Number of processes = 4
- Average TAT =
14/4 = 3.5
5) Average Waiting Time
- Formula: average WT =
(sum of WT) / number of processes - Subtitles indicate:
- Average waiting time result = 0.75
- (Implied sum of WT =
0.75 × 4 = 3)
Speakers / sources featured
- No individual speaker name is provided in the subtitles.
- Source is an educational video/channel: Gate smashers (referenced by the narrator).
Rate this summary
Your feedback will help improve summaries.
Improve this summary
Reprocess with a stronger model when the summary feels incomplete or inaccurate.
Translate summary in another language
Ask questions to this video
Chat for follow-up questions, clarifications, and source-backed answers.