FCFS
FCFS
Ichsan
Tahun Ajaran 2021 s.d 2022
L/O/G/O
First Come First Serve
• First Come First Serve is the full form of FCFS. It is
the easiest and most simple CPU scheduling
algorithm.
• In this type of algorithm, the process which requests
the CPU gets the CPU allocation first. This
scheduling method can be managed with a FIFO
queue.
• As the process enters the ready queue, its PCB
(Process Control Block) is linked with the tail of the
queue. So, when CPU becomes free, it should be
assigned to the process at the beginning of the queue.
2
Characteristics of FCFS method:
• It offers non-preemptive and pre-emptive scheduling
algorithm.
• Jobs are always executed on a first-come, first-serve
basis
• It is easy to implement and use.
• However, this method is poor in performance, and the
general wait time is quite high.
3
Calculating Average Waiting Time
• AWT or Average waiting time is the
average of the waiting times of the
processes in the queue, waiting for the
scheduler to pick them for execution.
4
Calculating Average Waiting Time-2
• Consider the processes P1, P2, P3, P4 given in the below table,
arrives for execution in the same order, with Arrival Time 0, and
given Burst Time, let's find the average waiting time using the FCFS
scheduling algorithm.
5
Calculating Average Waiting Time-3
• The average waiting time will be 18.75 ms
• For the above given proccesses, first P1 will be provided with the
CPU resources,
6
More explanation …
Process Arrival time Burst time
P1 0 21
P2 0 3
P3 0 6
P4 0 2
8
What is Convoy Effect
• Convoy Effect is a situation where
many processes, who need to use a
resource for short time are blocked by
one process holding that resource for
a long time.
• This essentially leads to poort
utilization of resources and hence
poor performance.
9
Latihan Soal FCFS (1)
• Jika diketahui 5 macam antrian
proses : A-B-C-D-E dengan waktu
kedatangan (Arrival Time) semuanya
0. Lama proses (Burst time) berturut-
turut adalah 5,2,6,8,3. Tentukakan
rata-rata waktu tunggu (AWT) dan
rata-rata Turn Around Time (ATAT).
10
Pembahasan Latihan Soal FCFS (1)
Process Arrival time Burst time
A 0 5
B 0 2
C 0 6
D 0 8
E 0 3
A 0 5
B 1 2
C 2 6
D 2 8
E 5 3
• Tentukan AWT ?
• Tentukan ATAT ?
12
Pembahasan Latihan Soal FCFS (2)
Process Arrival time Burst time
A 0 5
B 1 2
C 2 6
D 2 8
E 5 3
Process Arrival Burst time Waiting time End Turn around
time (Start Exect) Exec time
A 0 5 0 5 5
B 1 2 5 7 6
C 2 6 7 13 11
D 2 8 13 21 19
E 5 3 21 24 19
P1 0 24
P2 0 3
P3 0 3
14
Soal No.2
• Carilah AWT dan ATAT dari tabel di
bawah ini
Process Arrival time Burst time
P1 0 8
P2 1 4
P3 2 9
P4 3 5
15
Referensi
1. https://www.studytonight.com/operating-s
ystem/first-come-first-serve
2. https://www.u-
aizu.ac.jp/~yliu/teaching/os/lec10r.html
16
Merci…
L/O/G/O