Ospp Chap02 Part2
Ospp Chap02 Part2
mag head
IOdeuices
tape tail
unit 0 Giee
mag
tape hea
tail PCBa PCB4 PCBg
unit 1
disk head
unit 0 tail
PCB5
terminal head
unit 0 tall
a- bqueLue
Scucing DiagA m
VO queue VO request
time slice
expired
child fork a
executes child
A psocess 15
neuw
initialy put ib he aaadu
qucue. It waits tbuu urtil i6 is Selected or
execution, Os dispotcbed
Activity2
For events & 2, iden tiq the process
SEat es t b a t coTzeepond to h e evestS.
PnAwea
Egees Lo wailinG" SLcte Eheo back
t
too "sady ates Complutioro
a d y quee
Scheduless.
Long-teamJob Schedulae
the
Whenmultiple processes aue Submited,
S s e s Cle Seooled to a mass Storaqe device.
Proce
t s p*OCeLscs Jacm h i s Pcol
Job schedules selec
Eloads thcm mto memOY j o execu ton.
Lhem
propes
Scbeoduls mvst Select a
The lvng tam CPO-burd prOCessee
TlO-bound aod
mie o
L)o bouno, the reaoy q e
ue
all prOcessEsake
a n d b e shoxt-
shos
wil almost always empty
be
Lttle to dob.
team Schedule w i l l b a v e
tenm
all e prOcesses aAe CPU-bound, the I/Jo
L4
wiu dwaye almost alaye be
Wating queue
will go unuued, a n d again the
empty ,deoices
System wiu be unbalanced.
Swapping
move thbe rocess
àOm memory &
LatuUu-introduce to Comtine the
eecuton qrom bcs It
let o
CSwop out, Swap inS
Swapped-out processes
/O waiting
VO
queues
Context Switch
Swith'oq tbe Ceu to adtbes process by-
Savibq the State oj Cusrent proccke LPcA) S-
ustoring tbe State of a disjesant poces iss
Context Sutch.
Calleo as a
as be-
Coptet Switcb time is a pure Ovcs-bead
work_while Sutching
System doeg DO usejul
Key tams i
CentexE
State save.
Staie rcstore
nATE Question:
be
be 04 PrOCesses that can
Ihe m a i m u r A u m
Computes wth n
'nPraady
State yor a
CPUS is:
a) n 6> dndependent ay
Answe d
Long-Term Short-Termn Medium-Term
This scheduler is an
It is either absent or minimal in a It is insignificant in the time-
element of Time
time-sharing system. sharing order.
sharing systems
Speed is the fastest compared to
Speed is less compared to the
the short-term and medium-term It offers medium speed.
short term scheduler.
scheduler.
hxeads
Paocea is aPaDgram that pcayoams a Single
Jhread oj execuion.
seA Cannot SimulbaeOusly tyee in chaxcc.bexs-
E suo the Spell cbeckes Within he ccme.
PAOCess,
MCG
PCB oy
*PCB o4 al
all the Cusrcn t Pcescs have
a. Proces Reqislea aentry in
b. hocesc Toble
C. Praxarn Countu
Aoswer b
dProcess unttt
paecb
Opesaucns OD Pocesscs beqade
W can obtain a
usting pao ces uing4Lowig1
CCOmmands
*ps.
ps el
Pstre
OS
Csour cos di>ectly à m
Constzaincd to a Subset a the recouace
the
pocess.
O1 he paunt
he par ent may ave to paibition ts
its zcsos
eSouces
among its dhildsen o> it may be able to shae
haxe
Some esources ameng Severa l oj its Chilorer
Jhere
Jhere u aluo two address - Space possibiutis
O te ne paocess
7he
de child
proees ic a
duplcate t h e Pases
PucCess
Tre
The CLo pocesc bs
ne
Loaded nto . pioguam
foskC
Finclude Lunistsh>
pid-tfoxkCdid)
fasbi Cacates aDewproceseb4 dupuCatnd
the Calinq-procesc
Dea erocesS Cbile
Coalioq AroLess PaxeaE
They both
Jey iun
in Sepasat memoy spoce AE
aluays SICHLO
3he child doa not inhe» its paventss
memoyLo ck S.
pusabaeb
Ketuan lqpe
beqade
On s
the PlD 04 Child proc e s i s etuned to
OFailuse
l i s retwned in h e parent, bo Child is
Created, and exno s S c t to naicate b e
exroA
Pacgiam
ÉDcludecstdio.b>
Finclude Lonista.b>
int main)
forkC)
PinttC ospp\"S;
utun 0,-
Output.
OspP
OsPP
Both
oth paunt and child
Hence
patnt OsPp_on
Outputs Ospp twice,