0% found this document useful (0 votes)
18 views6 pages

Scheduling Algorithms Notes

The document outlines various scheduling algorithms including FCFS, SJF, SRTF, RR, and Preemptive Priority. Each algorithm is described with a table of process IDs, arrival times, and burst times, along with Gantt charts and calculations for waiting times and average turnaround times. The document provides a comprehensive comparison of these scheduling methods for process management.

Uploaded by

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

Scheduling Algorithms Notes

The document outlines various scheduling algorithms including FCFS, SJF, SRTF, RR, and Preemptive Priority. Each algorithm is described with a table of process IDs, arrival times, and burst times, along with Gantt charts and calculations for waiting times and average turnaround times. The document provides a comprehensive comparison of these scheduling methods for process management.

Uploaded by

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

SCHEDULING ALGORITHMS

FCFS = Based on ARRIVAL TIME

PID AT PT
GANTT CHART
A O S

B 3 4 A B C D E

08 12 17 20 22
C 4 5

D 6 3
-
ST + BT
E 10 2

RQ

AT DID BT

O A S

2 WATING TIME :
ST -

AT ARRIVAL TIME : WT + BT

3 B 4 A = 0 -0 :
& A = 0 + 8 = S

4 C 5 B :
S - 3 :
5 B = 5 + 4 =
9

5 C
:
12
-
4 :
S C = 8 + 5 = 13

6 D 3 D
=
17 - 6 :
1 D = 11 3
+
= 14

7 E ~ 20-10
:
10 E = 10 + 2 =
12

S
AXXT = 35/5 = 6 . 8 ms ATAT : 56/5 =
11 . 2 ms

18 E 2

SJF :
Based on BURST TIME

PID AT PT
GANTT CHART
A O S

B 3 4 A D E B C

08 11317
22
C 4 5
-
D 6 3
ST + BT

E 10 2

RQ

AT DID BT

O A S

2 WATING TIME :
ST -

AT ARRIVAL TIME : WT + BT

3 B 4 A = 0 -0 :
& A = 0 + 8 =
S

4 C 5 B : 13 - 3 : 10
B = 10 + 4 =
14

5 C
: 17 -
4 :
13 C = 13 + 5 : 18

6 D D
=
8 6 D =
5
3 : 2 = 2 +
z

E 11-10 2 = 3
E
:
7 - I = 1 +

S
AXXT = 26/5 =
5 2 . ms ATAT : 48/5 = .G
9 res

i E 2
SRTI

PID AT PT
GANTT CHART
A O S

su
B 3 4 C

·
C 4 5

D 6 3
ST + BT
E 10 2

RQ

AT DID BT
& preemt only if after () is still higher
O A S
-

3 =
2
-

I > at of B

2 WATING TIME :
ST -

AT ARRIVAL TIME : WT + BT

3 B 4 A = (0 -
0) + (12 -

3) =
9 A = a + 5 = 17

3 A
5 B :
3 -
3 : 0 B = 0 + 4 =
4

C 5 =
4 13 C = 13 + 5 : 18
4 c 17 :
-

D
=
5 D 7 6 : I = 1 + 3 =
4

6 D 3 E : 10-10 :
O E = 0 +
2 = 2

7 A XXT = 23/5 = 4 . 6 ms ATAT : 45/5 =


9 ms

18 E 2

PID AT PT
GANTT CHART
A 2 3

B
·
6 C A D E B

iina
i
C 4

D 5 5
ST + BT
E S 5

RQ

AT DID BT
·
/ no preemt since lower

O C 4 -

2 =
2
-

I WATING TIME :
ST -

AT ARRIVAL TIME : WT + BT

3 A A

3
A = 4 -
2 :
2 = 2 + 3 =
5

B :
17 -
4
:
13 B = 13 + 6
=
19

H c
=
0 -0 0 C = +
4 = 4
B
:
6 0

D
:

S D 5 D 7 3 :
2 = 2 +
g
=
7

G E -
12
-

8
:
4 E =
4 +
5
= 9

7 AXXT = 2 1/5 = 4 .
2 ms ATAT = 44/5 = 8 8 ms
.

S E 5
STRF

PID AT PT
GANTT CHART
Pi 8 6

P2 2

PgP
3 Pi

P3 3 5

P4 4 2

ST + BT
Ps 6 3

RQ

AT DID BT

O Pi 6 -
2
=
4 WATING TIME :
ST -

AT ARRIVAL TIME : WT + BT
-

I Still Pi = (0 -
0) + (10 -2) = s Pi = 8 + 6 = 14

higher
Pc P2

3
P2 3 L = c -
2 : O = 0 + 3 =
3

Pi 4 P3 :
14-3 : Pg = 11 + 5 : 16

3 P3 5 Pp =
g
-
4 = P4 = 1 + 2 = 3

4 P4 2 Ps - 7 -
6 : 1
Ps =
1 + 3 = 4

5 AXXT = 21 /5 = 4 .
2 ms ATAT = 40/5 = 8 res

6 PS 3

RR =
Based QUANTUM TIME ( for this question
on
Sams
:

PID AT PT
GANTT CHART
A O S

B 3 4 A B A CdBA EC

C 4 5 20

Ma i
is is is

D 6
-
3
ST + BT
E 10 2

RQ

AT DID BT

A 8
O 3 3
-
=

I & Quantum Time

3 B 4

# 3 A 5 -
3 = 2 WATING TIME :
ST -

AT ARRIVAL TIME : WT + BT

4 C 5 -
3 = 2 A = (0 - 0) (6 3) + -
+ (10 9) -
= 10 A = 10 + 8 = 18

5 B :
(3 -
3) +
(15 6) - = 9 B = 9 + 4 = 13

Positions
6 D 3 c
=
(a -
4) + (20 -

1) : 13 C = 13 + 5 =
18

G B I D
=
12 -
6 6 D = 6 3 =
are * : + a

E ~ 18-10 S E 8 + 2 -
10
based 7 : =

on S AXXT = 46/5 = 9 .
2 ms ATAT = 68/5 = 13 . 6 ms

END * a A 2

TIME 18 E 2

Il

# C 2
12
#R = 3 .
0 ms

PID AT PT
GANTT CHART
Pi G 6

D2 2 3 Pi Pe Po P, Do Pg Ps

Pe
-
3 5 11119

P4 4 2
ST + BT
Ps 6 3

RQ

AT DID BT

O PI 6 -
3 = 3

2 P2 3 WATING TIME :
ST -

AT ARRIVAL TIME : WT + BT

3 P3 5 -
3 = 2 Pi = (0 - 0) + (9 3) - :
6 Pi = 6 + 6 = 12

3 Pr 3 P :
(3-2) : Pc = 1 + 3 =
4

4 PH 2 Po =
(6 -

3) (x a) + -
:
11 Pz = 11 + 5 : 16

5 Pa
=
12
-
4 =
8 Py = 8 + 2 =
10

6 45 3 Ps : 14- 6 : S 45 = S +
3
I Il

AXXT 34/5 ATAT 93/5


"
=
=
= 6 8 ms
. =
10 . mS

9 P3 2

PREEMPTIVE PRIORITY

PID AT PRIORITY
PT Difference is
GANTT CHART
A j S 4 &

B 3 4 I A B CP E A

-n
C 4 5 2 12 15 17 22

D 6 3 2

ST + BT
E 10 2 .
3

RQ

AT DID BT P

O A 8- 3 = 5 4

2 WATING TIME :
ST -

AT ARRIVAL TIME : WT + BT

3 B 4 I A = (0 -
0) (k 3)+ - = 14 A = 14 + 8 =
22

3 A 5 4 B = 3 -
3 :
0 B = 0 + 4 = 4

4 C 5 2
C
=
< -
4 :
3 C = 3 + 5 : g

G D 3 2 D
=
12 - 6 : D = 6 + 3 =
a
6

7 E - 15-10 : 5
E = 5 + 2 I
7

S A XXT = 28/5 = 5 6 ms
.
ATAT :
50/5 = 10 ms

10 E 2 3
NON-PREEMPTIVE PRIORITY

PID AT PT PRIORITY
GANTT CHART
A j S 4

C
B 3

4
4

5
I

2
P
6 -
D 3 2

ST + BT
E 10 2 .
3

DID

S
B C -
2 - D -2 -
E -
2-
that arrived
RQ D 2 E -
2
until + ne ET
B's ET
AT PID BT Of A E-3 (arrived within the

O A S

2 WATING TIME :
ST -

AT ARRIVAL TIME : WT + BT

3 B 4 A = 0 - 0 = O A = 0 + S =
S

4 C 5 B = S - 3 =
5 B = 5 + 4
=
9

5 C
:
12 -

4
:
S C = 8 + g : 13

D
=
6 B 3 D 17 - 6 :
Il = 11 + 3 =
14

7 E : 20-10
:
10 E = 10 + 2 = 2

S A XXT = 34/5 =
6 8
.
ms ATAT = 36/5 = 11 2 .
mes

10 E 2

You might also like