0% found this document useful (0 votes)
52 views17 pages

FCFS

The document is about the First Come First Serve (FCFS) CPU scheduling algorithm. It provides 3 key points about FCFS: 1. FCFS is the simplest algorithm where the first process to request CPU time gets it. Processes are handled based on their order in the ready queue on a first come basis. 2. It has characteristics like being non-preemptive, with jobs always executed in order of arrival. However, average waiting times tend to be high. 3. Examples are provided to demonstrate calculating average waiting time and turnaround time for different processes under FCFS.

Uploaded by

M Farhan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
52 views17 pages

FCFS

The document is about the First Come First Serve (FCFS) CPU scheduling algorithm. It provides 3 key points about FCFS: 1. FCFS is the simplest algorithm where the first process to request CPU time gets it. Processes are handled based on their order in the ready queue on a first come basis. 2. It has characteristics like being non-preemptive, with jobs always executed in order of arrival. However, average waiting times tend to be high. 3. Examples are provided to demonstrate calculating average waiting time and turnaround time for different processes under FCFS.

Uploaded by

M Farhan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 17

SISTEM OPERASI

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.

• Lower the Average Waiting Time, better


the scheduling algorithm

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,

• Hence, waiting time for P1 will be 0


• P1 requires 21 ms for completion, hence waiting time for P2 will be
21 ms
• Similarly, waiting time for process P3 will be execution time of P1 +
execution time for P2, which will be (21 + 3) ms = 24 ms.
• For process P4 it will be the sum of execution times of P1, P2 and
P3.
• The GANTT chart above perfectly represents the waiting time for
each process.

6
More explanation …
Process Arrival time Burst time
P1 0 21
P2 0 3
P3 0 6
P4 0 2

Process Arrival Burst Waiting time End Exec Turn


time time (Start exec) around
time
P1 0 21 0 21 21
P2 0 3 21 24 24
P3 0 6 24 30 30
P4 0 2 30 32 32

Average Waiting Time (AWT) = (0 + 21 + 24 + 30)/4 = 18.75

Average Turn Around Time (ATAT) = (21 + 24 + 30 + 32)/4 = 26.75 7


TAT vs WT
• Turn Around Time: Time taken to complete
after arrival. In simple words, it is the
difference between the Completion time and
the Arrival time.
• Waiting Time: Total time the process has to
wait before it's execution begins. It is the
difference between the Turn Around time and
the Burst time of the process.

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

Process Arrival Burst time Waiting time End Exec Turn


time (Start Exec around
time
A 0 5 0 5 5
B 0 2 5 7 7
C 0 6 7 13 13
D 0 8 13 21 21
E 0 3 21 24 24

Average Waiting Time (AWT) = (0 + 5 + 7 + 13 + 21)/5 = 9.2


Average Turn Around Time (ATAT) = (5 + 7 + 13 + 21 + 24)/5 = 14 11
Latihan Soal FCFS (2)
• Soal diatas tidak disertai dengan waktu tiba /arrival time =
0 (same order).
• Diketahui tabel di bawah ini dengan arrival time yang
berbeda :
Process Arrival time Burst time

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

Average Waiting Time (AWT) = (0 + 5 + 7 + 13 + 21)/5 = 9.2


Average Turn Around Time (ATAT) = (5 + 6 + 11 + 19 + 19)/5 = 12 13
Soal No.1
• Carilah AWT dan ATAT dari tabel di
bawah ini
Process Arrival time Burst time

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

You might also like