OS Ass1

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 14

2-01-2024 VU22CSEND3 00324

AssiGNMENT-1
Dieence betwen thread scheduling aud
CPU scheduling.

Thvead Scheding cPu Scheduing

unit o Threads within a Proceeses


aworl proces

scope
Ler space oA Kenel spaee only
hernel spate
Opkimite CPU
Dptimie
execukon utiliation , acroSs
procese.
proess
Decison Thread ibrasy Oyeabing sy
maler scheduler Kernel

ExanyleWeb Senver handling, Allocaling ePU tie


multiple eqpeb |to mulbiple vunniug
toncureuy apli catons.

Rquit torhy', Kound Fees,sTF,Round


Robi Schedung Robia, Priovhy
Scheduling
a Explain about schedualng enleria.
A
Scheduling iheria

Maniníe Minimt

CPU Uklization Turauound

|Thoug put
|Rerponse tiaa,

a cPu uhilization:
Jhe amount. ime proteas
eneuted
yeal tme oS’40-4D.

Numbe proceses eneathg pea Unit

Jhe amouut o tme proes from


heation b,iminaionefuotees.
Jhe amount time wa spend: in the
seads stat fe ehe tuti on.

e Bust ine:
Jhe amount e time lick Spend for te
eXeution.

Jhe amount Hinie 'it tale fronn, when


'sulaniled until tes
Acquut was

prodáed.

pictori al epreeutabion te
rous neutipn)
Döpat:
giu te cautol to tle
A module that 8va
bo tue proes seleled by te shot
ternu scheduler

3Dirote Lateny kalues to stop


Sto one
Quote pro(ess.
roceas aud stant auohey
3 Explain about context suiteliug
techniqyue o metlhs
ued by tu operoking ylern to Suitce
a proes rom One skota to anothex
to eneue tt untn wiug CPUs in

’ whern Suitcing
it stasts e pld unnig proes statu
in te form o; rogises 'ond assigns
assighs te
CPU to a ne ho enecule
eMeeue it
þrotess.
tau.su axeution old
startt t that pont where anote
pros stopped it.

’ detiner the atiaakrishi..o a malti ta


wlic mutiple tauks shaned
e Sae
cpu to perorna multÛple,
tau wtthaut tu ned for addrtonal
proces ors in
skye ontext Suit hing
Protes P,

Tfreukg Dnirupt
Call
idle
Sove stat. inko PcB:

Reload stote hon PcB

sall

Save stat int PCB,

idle
Reload stat krom PeBo
Seukon
irst Context
suteliug ned to save tl

proq ramm Couuk. aud the regs ks


PeB wel i n e rumtg stfak.
Now updae PCB, to þrot eus Po aud Moves
"Iopviok queve, suck
as tie aeady quee , Jo qeus 'aud
wakug yeue
’Now
Noupdade PeB' or seled prottu P.4
ineude swittiuy proles
rendy to hunnfug' stae:
(PU SelyatligAgortens uit an
example.
A. Jhe main we sehedutig w to
make tu cilea" nioreieut

Tye: Preamylve
Non- Preenptve

Fist
Fut -Comme Serve (FEs)
* Shotat Job fist (sTE)
shailet Renaauing T it sRTF).
Piorthy
* Kound, Robn
Anval Ti)
.FCFS wthout
Protess Bust Time
24 msec

P2 3 mec

P3 3mec

GjonH Clat:
P
Pa
24 24 30

Dutut
Rroets Bust, Tine Conpletion, urnaroud Warting
Tine
24 24 24

24 24 24

30 24

ú1 TAT WT t BT

Turnauound hine 24429+30


3

S1nms
3

haage line
b424t24 ,5):
3 3
FeFs w Afoival ime)
ProiesAthival
Po 2
TimeBT
3

5
Py 2

Gant Chaut:
Po P
2 5 15 20

Output:
Roies Aral T.|Bnt, irnCTTAT'
TATwT
5 3
Po
0

15 5
6
5 20 12

Py 2

Ayerage Tunaaund Time 3+4+441242


5

33
5

Tine 0t[45+0
Watkng 5
13
5
SJF Wrlout Ahrivl Timu)
Pioces Bust Time

Pu 2

Ps

BRPy P' P
2 15 23

TA T WT
Potens BT

P 3

Py 2 3
3
8
23

Arae Turpaoud Tie I5+8+14 3423

ioge 5
54ms
STF wit. Aouval Tine)
Procas BTAT

4 Keody Sueue
5

P P P R,
12

i) WT=(TAT- BT

Proces AT BT TAT

P 2 12, |0.
4
5 4

Ave age Tumaouud Time : +1D+44|

&m'

Ayeoge Warhivg Time - 0+b+449 19


Riovity (witiout Aival Tine)
Proess BT Ptorhy
P
2

Ghantt Choat:
Ps P P Pu
l9

TAT WT+ BT,


WT+ BT: li),) wT: TAT-BT
ProLess TAT WT

P 3
P
P3 2

19 |8
5

Aasag G+0+1bt l8+1


5
. 2ms

Tunaoud Time: to
12 ms
PRonhy (wil kaialhine)
RoLus B1 Pioh AT
2.
P
2
1

Py 3 Keay Queve
antt Clat:
Pi Py
6 Lo 1
13

Dutput: TCT
Proceys BT Pror hy AT TAT Wt
P 2

2 ||
2

3 3 5 5 13

tit) wT TAT-BT

Aage Woitng Tin Dt11425

Avaage Turnaouud Tiwme b41t68

32
SRTF Shon leat Remating Tínne .Fist)
Vroess BT

P
21
Ready Queie
Py
Gant Chat:
Pyl P
2 3 4 14

Poeus AT BT, CTTAT WT


P
5
2 4 26 24
3 2

W1TAT-CT- AT

Avaage Turmaound Time i 19+442444


2
4
52 13 ms

Avaoge wastiug imne 4t0t1St2

= 26 :6Sms .

4
Round Robin (rR)
Poes BT AT TO:3ms

24

3 2 Reacy Quee

Gant Chant:
Pi
3 12 1s 19 '21 y'2 30

Oubyut: TAT
ProLes BT
30 30
P 24
5 2
1
3

P
(ii) WT TAT-BT

Aveage Turnauwd Tine : 30+5 t9

Average wWarhing 7ine


3 3
3 nS

You might also like