.

Теория Операционных Систем

Язык: русский
Формат: реферат
Тип документа: Word Doc
0 1438
Скачать документ

Oai?ey iia?aoeeiiiuo nenoai

Aaaaeaiea. Iniiaiua iiiyoey e ii?aaeaeaiey.

Iia?aoeeiiiay nenoaia – yoi i?ia?aiia, eioi?ay auiieiyao ooieoeee
iin?aaeieea iaaeaeo iieueciaaoaeai e eiiiuethoa?ii.

IN, auiieiyy ?ieue iin?aaeieea, neoaeeo aeaoi oeaeyi:

yooaeoeaii eniieueciaaoue eiiiuethoa?iua ?ano?nu.

nicaeaaaoue oneiaey aeey yooaeoeaiie ?aaiou iieueciaaoaey

A ea/anoaa ?ano?nia eiiiuethoa?a iau/ii ?anniao?eaatho:

a?aiy ?aaiou i?ioeanni?a

aae?aniia i?ino?ainoai iniiaiie iaiyoe

iai?oaeiaaiea aaiaea – auaiaea

oaeeu, o?aiyueany ai aiaoiae iaiyoe

Ia ?enoiea i?eaaaeaiu iniiaiua eiiiiiaiou IN eae nenoaiu ?acaeaeaiey
?ano?nia.

Oaeei ia?acii, iniiaiua eiiiiiaiou IN:

oi?aaeaiea i?ioeannaie (?ani?aaeaeyao ?ano?n — i?ioeanni?iia a?aiy);

oi?aaeaiea iaiyoueth (?ani?aaeaeyao ?ano?n — aae?aniia i?ino?ainoai
iniiaiie iaiyoe);

oi?aaeaiea ono?ienoaaie (?ani?aaeaeyao ?ano?nu) — iai?oaeiaaiea
aaiaea – auaiaea;

oi?aaeaiea aeaiiuie (?ani?aaeaeyao ?ano?n — aeaiiua eee oaeeu).

Ooieoeeiie?iaaiea eiiiuethoa?a iinea aeeth/aiey ieoaiey ia/eiaaony n
caionea i?ia?aiiu ia?aiia/aeueiie caa?ocee — Boot Track. I?ia?aiia Boot
Track eieoeeaeece?oao iniiaiua aiia?aoiua aeiee eiiiuethoa?a e ?aaeno?u
i?ioeanni?a (CPU), iaeiieoaeue iaiyoe, eiio?ieea?u ia?eoa?eeiiai
iai?oaeiaaiey. Caoai caa?oaeaaony yae?i IN, oi aeoue Operating System
Kernel. Aeaeueiaeoaa ooieoeeiie?iaaiea IN inouanoaeyaony eae ?aaeoeey ia
niauoey, i?ienoiaeyuea a eiiiuethoa?a. Ianooieaiea oiai eee eiiai
niauoey neaiaeece?oaony i?a?uaaieyie – Interrupt. Enoi/ieeaie i?a?uaaiee
iiaoo auoue eae aiia?aoo?a (HardWare), oae e i?ia?aiiu (SoftWare).

Aiia?aoo?a “niiauaao” i i?a?uaaiee aneio?iiii (a ethaie iiiaio a?aiaie)
iooai ia?anueee a CPU /a?ac iauoth oeio neaiaeia i?a?uaaiee. I?ia?aiia
“niiauaao” i i?a?uaaiee iooai auiieiaiey iia?aoeee System Call. I?eia?u
niauoee, aucuaathueo i?a?uaaiey:

iiiuoea aeaeaiey ia 0

cai?in ia nenoaiiia ianeoaeeaaiea

caaa?oaiea iia?aoeee aaiaea – auaiaea

iai?aaeeueiia ia?auaiea e iaiyoe

Eaaeaeia i?a?uaaiea ia?aaaouaaaony niioaaonoaaiii ia?aaio/eeii
i?a?uaaiee (Interrupt handler), aoiaeyuei a ninoaa IN.

Aeaaiua ooieoeee iaoaiecia i?a?uaaiee — yoi:

?aniiciaaaiea eee eeanneoeeaoeey i?a?uaaiee

ia?aaea/a oi?aaeaiey niioaaonoaaiii ia?aaio/eeo i?a?uaaiee

ei??aeoiia aica?auaiea e i?a?aaiiie i?ia?aiia

Ia?aoiae io i?a?uaaaiie i?ia?aiiu e ia?aaio/eeo e ia?aoii aeieaeai
auiieiyoueny eae iiaeii auno?ae. Iaeiei ec auno?uo iaoiaeia yaeyaony
eniieueciaaiea oaaeeoeu, niaea?aeauae ia?a/aiue anao aeiionoeiuo aeey
eiiiuethoa?a i?a?uaaiee e aae?ana niioaaonoaothueo ia?aaio/eeia. Oaeay
oaaeeoea iacuaaaony aaeoi?ii i?a?uaaiee (Interrupt vector) e o?aieony a
ia/aea aae?aniiai i?ino?ainoaa iniiaiie iaiyoe (UNIX/MS DOS).

Aeey ei??aeoiiai aica?auaiey e i?a?aaiiie i?ia?aiia ia?aae ia?aaea/ae
oi?aaeaiey ia?aaio/eeo i?a?uaaiee, niaea?aeeiia ?aaeno?ia i?ioeanni?a
caiiieiaaony eeai a iaiyoe n i?yiui aeinooiii eeai a nenoaiiii noaea —
System Stack.

Iau/ii cai?auathony i?a?uaaiey ia?aaio/eea i?a?uaaiee. Iaeiaei, a
iaeioi?uo IN i?a?uaaiey niaaaeathony i?ei?eoaoaie, oi anoue ?aaioa
ia?aaio/eea i?a?uaaiey n aieaa ieceei i?ei?eoaoii iiaeao auoue i?a?aaia,
anee i?iecioei i?a?uaaiea n aieaa aunieei i?ei?eoaoii.

1. Oi?aaeaiea i?ioeannaie.

I?ioeann — yoi i?ia?aiiiue iiaeoeue, auiieiyaiue a CPU. Iia?aoeeiiiay
nenoaia eiio?iee?oao neaaeothuoth aeayoaeueiinoue, naycaiioth n
i?ioeannaie:

nicaeaiea e oaeaeaiea i?ioeannia

ieaie?iaaiea i?ioeannia

neio?iiecaoeey i?ioeannia

eiiioieeaoeey i?ioeannia

?ac?aoaiea ooieeiauo neooaoeee

1.1 Iiiyoea I?ioeann. Ninoiyiey i?ioeanna

Ia neaaeoao niaoeaaoue iiiyoey i?ioeann e i?ia?aiia. I?ia?aiia — yoi
ieai aeaenoaee, a i?ioeann — yoi naii aeaenoaea. Iiiyoea i?ioeann
aeeth/aao:

i?ia?aiiiue eiae

aeaiiua

niaea?aeeiia noaea

niaea?aeeiia aae?aniiai e ae?oaeo ?aaeno?ia CPU.

Oaeei ia?acii, aeey iaeiie i?ia?aiiu iiaoo auoue nicaeaiu ianeieueei
i?ioeannia, a oii neo/aa, anee n iiiiuueth iaeiie i?ia?aiiu a
eiiiuethoa?a auiieiyaony ianeieueei ianiaiaaeathueo
iineaaeiaaoaeueiinoae eiiaiae. Ca a?aiy nouanoaiaaiey i?ioeann
iiiaie?aoii eciaiyao naia ninoiyiea.

?acee/atho neaaeothuea ninoiyiey i?ioeanna:

iiaue (new, i?ioeann oieueei /oi nicaeai)

auiieiyaiue (running, eiiaiaeu i?ia?aiiu auiieiythony a CPU)

iaeeaeathuee (waiting, i?ioeann iaeeaeaao caaa?oaiey iaeioi?iai niauoey,
/aua anaai iia?aoeee aaiaea – auaiaea)

aioiaue (ready, i?ioeann iaeeaeaao inaiaiaeaeaiey CPU)

caaa?oaiiue (terminated, i?ioeann caaa?oee naith ?aaioo)

Ia?aoiae ec iaeiiai ninoiyiey a ae?oaia ia iiaeao auiieiyoueny
i?iecaieueiui ia?acii. Ia ?enoiea i?eaaaeaia oeiiaay aeeaa?aiia
ia?aoiaeia aeey ninoiyiee i?ioeanni?a.

Eaaeaeue i?ioeann i?aaenoaaeai a iia?aoeeiiiie nenoaia iaai?ii aeaiiuo,
iacuaaaiuo process control block . A process control block i?ioeann
iienuaaaony iaai?ii cia/aiee, ia?aiao?ia, oa?aeoa?ecothueo aai oaeouaa
ninoiyiea e eniieuecoaiuo iia?aoeeiiiie nenoaiie aeey oi?aaeaiey
i?ioiaeaeaieai i?ioeanna /a?ac eiiiuethoa?.

Ia ?enoiea noaiaoe/anee iieacaii, eaeei ia?acii iia?aoeeiiiay nenoaia
eniieuecoao process control block aeey ia?aeeth/aiey i?ioeanni?a n
iaeiiai i?ioeanna ia ae?oaie.

time

1.2. Ieaie?iaaiea i?ioeannia. Iiiyoea i/a?aaee.

Nenoaia oi?aaeaiey i?ioeannaie iaania/eaaao i?ioiaeaeaiea i?ioeanna
/a?ac eiiiuethoa?. A caaeneiinoe io ninoiyiey i?ioeanna aio aeieaeai
auoue i?aaeinoaaeoue oio eee eiie ?ano?n. Iai?eia?, iiaue i?ioeann
iaiaoiaeeii ?acianoeoue a iniiaiie iaiyoe, neaaeiaaoaeueii, aio
iaiaoiaeeii auaeaeeoue /anoue aae?aniiai i?ino?ainoaa. I?ioeanno a
ninoiyiee aioiaue aeieaeii auoue i?aaeinoaaeaii i?ioeanni?iia a?aiy.
Auiieiyaiue i?ioeann iiaeao iio?aaiaaoue iai?oaeiaaiea aaiaea – auaiaea
e aeinooi e oaeeo.

I/a?aaeue e

ia?aue

PCB5

oa?ieiaeo

? 1

iineaaeiee

?ani?aaeaeaiea i?ioeannia iaaeaeo eiathueieny ?ano?naie iineo iacaaiea
ieaie?iaaiea i?ioeannia. Iaeiei ec iaoiaeii ieaie?iaaiey i?ioeannia,
i?eaioe?iaaiiuo ia yooaeoeaioth caa?oceo ?ano?nia, yaeyaony iaoiae
i/a?aaeae ?ano?nia. Iiaua i?ioeannu iaoiaeyony ai aoiaeiie i/a?aaee,
/anoi iacuaaaiie i/a?aaeueth ?aaio – caaeaiee (job queue).

Aoiaeiay i/a?aaeue ?aniieaaaaony ai aiaoiae iaiyoe, ai aoiaeiie
i/a?aaee i?ioeannu iaeeaeatho inaiaiaeaeaiey ?ano?na — aae?aniiai
i?ino?ainoaa iniiaiie iaiyoe.

Aioiaua e auiieiaieth i?ioeannu ?aniieaaathony a iniiaiie iaiyoe e
naycaiu i/a?aaeueth aioiauo i?ioeannia eee ready queue. I?ioeannu a yoie
i/a?aaee iaeeaeatho inaiaiaeaeaiey ?ano?na i?ioeanni?iia a?aiy.

I?ioeann a ninoiyiee iaeeaeaiey caaa?oaiey iia?aoeee aaiaea – auaiaea
iaoiaeeony a iaeiie ec i/a?aaeae e iai?oaeiaaieth aaiaea – auaiaea,
eioi?ay iineo iacaaiea devices queue.

I?e i?ioiaeaeaiee /a?ac eiiiuethoa? i?ioeann iea?e?oao iaaeaeo
?acee/iuie i/a?aaeyie iiae oi?aaeaieai i?ia?aiiu, eioi?ay iacuaaaony
ieaie?iauee. (scheduler) Iia?aoeeiiiay nenoaia, iaania/eaathuay ?aaeei
ioeueoei?ia?aiie?iaaiey, iau/ii aeeth/aao aeaa ieaie?iaueea —
aeieain?i/iue (long term scheduler) e e?aoein?i/iue (short term
scheduler/CPU scheduler).

Iniiaiia ioee/ea iaaeaeo aeieain?i/iui e e?aoein?i/iui ieaie?iaueeaie
caeeth/aaony a /anoioa caionea, iai?eia?: e?aoein?i/iue ieaie?iauee
iiaeao caioneaoueny eaaeaeua 100 in, aeieain?i/iue — iaeei ?ac ca
ianeieueei ieioo.

Aeieain?i/iue ieaie?iauee ?aoaao, eaeie ec i?ioeannia, iaoiaeyueony ai
aoiaeiie i/a?aaee, aeieaeai auoue ia?aaaaeai a i/a?aaeue aioiauo
i?ioeannia a neo/aa inaiaiaeaeaiey ?ano?nia iaiyoe.

Aeieain?i/iue ieaie?iauee auae?aao i?ioeann ec aoiaeiie i/a?aaee n
oeaeueth nicaeaiey iaiaeii?iaeiie ioeueoei?ia?aiiiie niane. Yoi
icia/aao, /oi a i/a?aaee aioiauo i?ioeannia aeieaeiu iaoiaeeoueny a
?aciie i?iii?oeee eae i?ioeannu, i?eaioe?iaaiiua ia aaiae – auaiae, oae
e i?ioeannu, i?eaioe?iaaiiua ia i?aeiouanoaaiioth ?aaioo n CPU.

E?aoein?i/iue ieaie?iauee ?aoaao, eaeie ec i?ioeannia, iaoiaeyueony a
i/a?aaee aioiauo i?ioeannia, aeieaeai auoue ia?aaeai ia auiieiaiea a
CPU. A iaeioi?uo iia?aoeeiiiuo nenoaiao aeieain?i/iue ieaie?iauee iiaeao
ionoonoaiaaoue. Iai?eia?, a nenoaiao ?acaeaeaiey a?aiaie (time sharing
system), eaaeaeue iiaue i?ioeann n?aco aea iiiauaaony a iniiaioth
iaiyoue.

1.3. Acaeiiaeaenoaea i?ioeannia. Iieueciaaoaeueneee o?iaaiue.

Niaianoii auiieiyaiua i?ioeannu iiaoo auoue eeai iacaaeneiuie
(independed processes), eeai acaeiiaeaenoaothueie (cooperating
processes). Acaeiiaeaenoaea i?ioeannia /anoi iiieiaaony a niunea
acaeiiiai iaiaia aeaiiuie /a?ac iauee aooa? aeaiiuo.

Acaeiiaeaenoaea i?ioeannia oaeiaii ?anniao?eaaoue a noaia
i?iecaiaeeoaeue – iio?aaeoaeue (produces – consumer). Iai?eia?,
i?ia?aiia auaiaea ia ia/aoue i?iecaiaeeo iineaaeiaaoaeueiinoue neiaieia,
eioi?ua iio?aaeythony ae?aeaa?ii i?eioa?a eee eiiieeyoi? i?iecaiaeeo
annaiaea?iue oaeno, eioi?ue caoai iio?aaeyaony annaiaea?ii.

Aeey oiai, /oiau i?ioeann – i?iecaiaeeoaeue e i?ioeann – iio?aaeoaeue
iiaee caiieiyoue niaianoii iaiaoiaeeiue aooa?, caiieiyaiue i?ioeannii –
i?iecaiaeeoaeai e iio?aaeyaiui i?ioeannii – iio?aaeoaeai.

Aooa? eiaao oeene?iaaiiua ?acia?u, e neaaeiaaoaeueii i?ioeannu iiaoo
iaoiaeeoueny a ninoiyiee iaeeaeaiey, eiaaea:

aooa? caiieiai; iaeeaeaao i?ioeann – i?iecaiaeeoaeue

aooa? iono; iaeeaeaao i?ioeann – iio?aaeoaeue

Aooa? iiaeao i?aaeinoaaeyoueny e iiaeaea?aeeaaoueny naiie IN, iai?eia?
n iiiiuueth n?aaenoa eiiioieeaoeee i?ioeannia (IPC — Inter Process
Communication), eeai i?aaieciaaoue i?eeeaaeiui i?ia?aiienoii. I?e yoii
iaa i?ioeanna eniieuecotho iauee o/anoie iaiyoe, iai?eia? i?ioeann –
i?iecaiaeeoaeue e i?ioeann – iio?aaeoaeue iiaoo eniieueciaaoue
neaaeothuea ia?aiaiiua:

Var n;

type item=…;

Var buffer:array[0..n-1] of item;

in, out:0..n-1;, aaea n – eiee/anoai aae?anoaiuo yeaiaioia aooa?a, Item
– eiy oeia yeaiaioia aooa?a, in, out – oeacaoaee, oa?aeoa?ecothuea
caiieiaiea aooa?a.

Aooa? i?aaenoaaeai a aeaea oeeeee/anee naycaiiiai ianneaa aae?anoaiuo
yeaiaioia n aeaoiy oeacaoaeyie – in, out. Oeacaoaeue in niaea?aeeo iiia?
ia?aiai naiaiaeiiai yeaiaioa aooa?a, a out – ia?aiai caiyoiai yeaiaioa
aooa?a.

0 1 2 3 4 5

n-1

Iono. in=out. I/aaeaeii, /oi aooa? iono a oii neo/aa, anee auiieiyaony
yoi oneiaea.

Aooa? aoaeao iieiinoueth caiieiai, anee auiieiyaony oneiaea

(in+1) mod n = out

I?ioeann – i?iecaiaeeoaeue aeieaeai auiieiyoue i?ioeaaeo?o caiene a
aooa? oeia

Repeat

i?iaeooee?oaony i/a?aaeiie yeaiaio a Next p

while (in+1) mod n = out do no_op;

buffer (in):=next p;

in:=(in+1) mod n;

until false

aaea Next p – eieaeueiay ia?aiaiiay i?ioeanna – i?iecaiaeeoaey, a
eioi?ie o?aieony i/a?aaeiie i?iaeooee?oaiue yeaiaio

no_op – ionoie iia?aoi?

I?ioeann – iio?aaeoaeue aeieaeai auiieiyoue i?ioeaaeo?o /oaiey ec aooa?a
oeia

Repeat

while in out do no_op;

next p := buffer (out);

out:=(out+1) mod n;

iio?aaeyaony i/a?aaeiie yeaiaio ec Next n

until false

2. Ieaie?iaaiea i?ioeanni?a.

E?aoein?i/iue ieaie?iauee auae?aao i?ioeannu ec i/a?aaee aioiauo
i?ioeannia e ia?aaeaao eo ia auiieiaiea a CPU. Nouanoaotho ?acee/iu
aeai?eoiu eee no?aoaaee ?aoaiey yoie caaea/e, ioee/athueany ioiioaieai e
e?eoa?eyi ieaie?iaaiey.

2.1. E?eoa?ee ieaie?iaaiey i?ioeanni?a.

Eniieuecothony neaaeothuea e?eoa?ee, iicaieythuea n?aaieaaoue aeai?eoiu
e?aoein?i/iuo ieaie?iaueeia:

ooeeecaoeey CPU (eniieueciaaiea) CPU utilization. ooeeecaoeey CPU
oai?aoe/anee iiaeao iaoiaeeoueny i?aaeaeao io 0 aei 100%. A ?aaeueiuo
nenoaiao ooeeecaoeey CPU eieaaeaony a i?aaeaeao 40% aeey eaaei
caa?oaeaiiiai CPU, 90% aeey oyaeaei caa?oaeaiiiai CPU.

i?iioneiay niiniaiinoue CPU throughput. I?iioneiay niiniaiinoue CPU
iiaeao ecia?youeny eiee/anoaii i?ioeannia, eioi?ua auiieiythony a
aaeeieoeo a?aiaie.

a?aiy iai?ioa (turnaround time) aeey iaeioi?uo i?ioeannia aaaeiui
e?eoa?eai yaeyaony iieiia a?aiy auiieiaiey, oi anoue eioa?aae io iiiaioa
iiyaeaiey i?ioeanna ai aoiaeiie i/a?aaee aei iiiaioa aai caaa?oaiey. Yoi
a?aiy iacaaii a?aiaiai iai?ioa e aeeth/aao a?aiy iaeeaeaiey ai aoiaeiie
i/a?aaee, a?aiy iaeeaeaiey a i/a?aaee aioiauo i?ioeannia, a?aiy
iaeeaeaiey a i/a?aaeyo e iai?oaeiaaieth, a?aiy auiieiaiey a i?ioeanni?a
e a?aiy aaiaea – auaiaea.

a?aiy iaeeaeaiey (waiting time). iiae a?aiaiai iaeeaeaiey iiieiaaony
noiia?iia a?aiy iaoiaeaeaiey i?ioeanna a i/a?aaee aioiauo i?ioeannia.

a?aiy ioeeeea (response time) aeey noaoai eioa?aeoeaiuo i?ia?aii aaaeiui
iieacaoaeai yaeyaony a?aiy ioeeeea eee a?aiy, i?ioaaeoaa io iiiaioa
iiiaaeaiey i?ioeanna ai aoiaeioth i/a?aaeue aei iiiaioa ia?aiai
ia?auaiey e oa?ieiaeo.

I/aaeaeii, /oi i?inoaeoay no?aoaaey e?aoein?i/iiai ieaie?iaueea
aeieaeia auoue iai?aaeaia ia iaeneiecaoeeth n?aaeieo cia/aiee
caa?oaeaiiinoe e i?iioneiie niiniaiinoe, a?aiaie iaeeaeaiey e a?aiaie
ioeeeea.

A ?yaea neo/aaa eniieuecothony neiaeiua e?eoa?ee, iai?eia? oae
iacuaaaiue ieieiaeniue e?eoa?ee, oi anoue aianoi i?inoiai e?eoa?ey
ieieioi n?aaeiaai a?aiaie ioeeeea eniieuecoaony neaaeothuee — ieieioi
iaeneiaeueiiai a?aiaie ioeeeea.

2.2. No?aoaaee ieaie?iaaiey i?ioeanni?a.

2.2.1.Ia?aue i?eoae — ia?aue ianeoaeeaaaony FIFO. first come — first
served (FCFS).

FCFS yaeyaony iaeaieaa i?inoie no?aoaaeae ieaie?iaaiey i?ioeannia e
caeeth/aaony a oii, /oi i?ioeanni? ia?aaeaaony oiio i?ioeanno, eioi?ue
?aiueoa anao ae?oaeo aai cai?inee.

Eiaaea i?ioeann iiiaaeaao a i/a?aaeue aioiauo i?ioeannia, process
control block i?eniaaeeiyaony e oainoo i/a?aaee.

N?aaeiaa a?aiy iaeeaeaiey aeey no?aoaaee FCFS /anoi aanueia aaeeei e
caaeneo io ii?yaeea iinooieaiey i?ioeannia a i/a?aaeue aioiauo
i?ioeannia.

I?eia? ? 1

Ionoue o?e i?ioeanna iiiaaeatho a i/a?aaeue iaeiia?aiaiii a iiiaio 0 e
eiatho neaaeothuea cia/aiey a?aiaie iineaaeothuaai ianeoaeeaaiey a CPU.

aa?eaio 1:

I1(24 in)

I2(3 in)

I3(3 in)

aa?eaio 2:

I2(3 in)

I3(3 in)

I1(24 in)

Ia ?enoiea i?eaaaeaiu aeeaa?aiiu Aaiaa i/a?aaee aioiauo i?ioeannia

aa?eaio 1:

I1 I2 I3 WT=17 in

WT1=0 in WT2=24 in WT3=27 in

aa?eaio 2:

I2 I3 I1 WT=3 in

WT2=0 in WT3=3 in WT1=6 in

No?aoaaee FCFS i?enou oae iacuaaaiue “yooaeo eiiaiy”. A oii neo/aa,
eiaaea a eiiiuethoa?a eiaaony iaeei aieueoie i?ioeann e ianeieueei
iaeuo, oi ana i?ioeannu niae?athony a ia/aea i/a?aaee aioiauo
i?ioeannia, a caoai a i/a?aaee e iai?oaeiaaieth. Oaeei ia?acii, “yooaeo
eiiaiy” i?eaiaeeo e nieaeaieth caa?oaeaiiinoe eae i?ioeanni?a, oae e
ia?eoa?eeiiai iai?oaeiaaiey.

2.2.2. No?aoaaey iaeaieaa ei?ioeay ?aaioa — aia?aae e iiaaaea eiiioiecia
! SJF

SJF — Shortest Job First. Iaeiei ec iaoiaeia ai?ueau n “yooaeoii
eiiaiy” yaeyaony no?aoaaey, iicaieythuay i?ioeanno ec i/a?aaee
auiieiyoueny ia?aui.

I?eia? ? 2

Ionoue /aou?a i?ioeanna iaeiia?aiaiii iiiaaeatho a i/a?aaeue aioiauo
i?ioeannia e eiatho neaaeothuea cia/aiey a?aiaie iineaaeothuaai
ianeoaeeaaiey

I1(6 in)

I2(8 in)

I3(7 in)

I4(3 in)

Ia ?enoiea i?eaaaeaia aeeaa?aiia Aaiaa, iino?iaiiay a niioaaonoaee ni
no?aoaaeae SJF.

I4 I1 I3 I2 WT=7 in

WT4=0 in WT1=3 in WT3=9 in WT2=16 in

Eaaei iin/eoaoue, /oi i?e eniieueciaaiee FCFS – no?aoaaee n?aaeiaa
a?aiy iaeeaeaiey aeey oao aea i?ioeannia ?aaii 10.25 in, oaeei ia?acii
no?aoaaey SJF nieaeaao a?aiy iaeeaeaiey i/a?aaee. Iaeaieueoay
o?oaeiinoue a i?aeoe/aneie ?aaeecaoeee SJF caeeth/aaony a iaaiciiaeiinoe
ca?aiaa ii?aaeaeeoue aaee/eio a?aiaie iineaaeothuaai ianeoaeeaaiey.

Iiyoiio no?aoaaey SJF /anoi i?eiaiyaony a aeieain?i/iuo ieaie?iaueeao,
ianeoaeeaathueo iaeaoiue ?aaeei. A yoii neo/aa aianoi aaee/eiu a?aiaie
iineaaeothuaai ianeoaeeaaiey eniieuecoaony aeiionoeiia iaeneiaeueiia
a?aiy auiieiaiey caaeaiey, eioi?ia i?ia?aiieno aeieaeai
niaoeeoeoee?iaaoue ia?aae ioi?aaeie caaeaiey a iaeao.

2.2.3. I?ei?eoaoiia ieaie?iaaiea.

Iienaiiua ?aiaa no?aoaaee iiaoo ?anniao?eaaoueny eae /anoiua neo/ae
no?aoaaee i?ei?eoaoiiai ieaie?iaaiey. Yoa no?aoaaey i?aaeiieaaaao, /oi
eaaeaeiio i?ioeanno i?eienuaaaony i?ei?eoao, ii?aaeaeythuee
i/a?aaeiinoue i?aaeinoaaeaiey aio CPU. Iai?eia?, no?aoaaey FCFS
i?aaeiieaaaao, /oi ana i?ioeannu i?aaeiieaaaao, /oi ana i?ioeannu eiatho
iaeeiaeiaua i?ei?eoaou, a no?aoaaey SJF i?aaeiieaaaao, /oi i?ei?eoao
anoue aaee/eia, ia?aoiay a?aiaie iineaaeothuaai ianeoaeeaaiey.

I?ei?eoao — yoi oeaeia iieiaeeoaeueiia /enei, iaoiaeyuaany a iaeioi?ii
aeeaiaciia, iai?eia? io 0 aei 7, io 0 aei 4095. Aoaeai n/eoaoue, /oi /ai
iaiueoa cia/aiea /enea, oai auoa i?ei?eoao i?ioeanna.

I?eia? ?3. i?ei?eoao

I1(10 in) 3

I2(1 in) 1

I3(2 in) 3

I4(1 in) 4

I5(5 in) 2

Ia ?enoiea i?eaaaeaia aeeaa?aiia Aaiaa, ?aniieaaathuay i?ioeannu a
i/a?aaee a niioaaonoaee ni no?aoaaeae i?ei?eoaoiiai ieaie?iaaiey

I2 I5 I1 I3 I4

WT2=0 in WT5=1 in WT1=6 in WT3=16 in WT4=18 in

I?ei?eoaou ii?aaeaeythony enoiaey ec niaieoiiinoe aioo?aiieo e aiaoieo
ii ioiioaieth e iia?aoeeiiiie nenoaia oaeoi?ia.

Aioo?aiiea oaeoi?u:

o?aaiaaiey e iaiyoe

eiee/anoai ioe?uouo oaeeia

ioiioaiea n?aaeiaai a?aiaie aaiaea – auaiaea e n?aaeiaio a?aiaie CPU e
oae aeaeaa

Aiaoiea oaeoi?u:

aaaeiinoue i?ioeanna

oei e aaee/eia oaeeia, eniieuecoaiuo aeey iieaou

ioaeaeaiea, auiieiythuaa ?aaiou e oae aeaeaa

Aioo?aiiea oaeoi?u iiaoo eniieueciaaoueny aeey aaoiiaoe/aneiai
iacia/aiey i?ei?eoaoia naiie iia?aoeeiiiie nenoaiie, a aiaoiea aeey
i?eioaeeoaeueiiai, n iiiiuueth iia?aoi?a.

Aeaaiue iaaeinoaoie i?ei?eoaoiiai ieaie?iaaiey caeeth/aaony a
aiciiaeiinoe aeiee?iaaiey ia iaii?aaeaeaiii aeieaia a?aiy
ieceii?ei?eoaoiuo i?ioeannia.

Ecaanoai neo/ae, eiaaea a 1973 aiaeo a Ianna/onaoneii oaoiieiae/aneii
einoeoooa MIT i?e inoaiiaea eiiiuethoa?a IBM 7094 a i/a?aaee aioiauo
i?ioeannia auee iaia?oaeaiu i?ioeannu, i?aaenoaaeaiiua a 1967 e ana aua
ia auiieiaiiua.

Aeey ono?aiaiey ioia/aiiiai iaaeinoaoea eniieuecothony neaaeothuea
iaoiaeu: i?ioeannu, a?aiy iaeeaeaiey eioi?uo i?aauoaao oeene?iaaiioth
aaee/eio, iai?eia? 15 ieioo, aaoiiaoe/anee iieo/atho aaeeie/iia
i?e?auaiea i?ei?eoaoa.

2.2.4. “Ea?onaeueiay” no?aoaaey ieaie?iaaiey.

RR-Round Robin

Round Robin no?aoaaey i?eiaiyaony a nenoaiao ?acaeaeaiey a?aiaie.
Ii?aaeaeyaony iaaieueoie io?acie a?aiaie, iacaaiiue eaaioii a?aiaie
(10..100 in). I/a?aaeue aioiauo i?ioeannia ?anniao?eaaaony eae
eieueoeaaay. I?ioeannu oeeeee/anee ia?aiauathony ii i/a?aaee, iieo/ay
CPU ia a?aiy, ?aaiia iaeiiio eaaioo. Iiaue i?ioeann aeiaaaeyaony a oaino
i/a?aaee. Anee i?ioeann ia caaa?oeeny a i?aaeaeao auaeaeaiiiai aio
eaaioa a?aiaie, aai ?aaioa i?eioaeeoaeueii i?a?uaaaony, e ii
ia?aiauaaony a oaino i/a?aaee.

I?eia? 4

I1(24 in)

I2(3 in)

I3(3 in)

q=4 in.

Aeeaa?aiia Aaiaa niioaaonoaaiii Round Robin no?aoaaee aeey yoiai neo/ay
eiaao aeae:

I1 I2 I3 I1 I1 I1 I1 I1

WT1=0 in 7 10 14 18 22 26 30

Naienoaa Round Robin no?aoaaee neeueii caaenyo io aaee/eiu a?aiaiiiai
eaaioa q. *ai aieueoa a?aiaiiie eaaio, oai aeieueoa Round Robin
no?aoaaey i?eaeeaeaaony e FCFS no?aoaaee. (aeey ?anniio?aiiiai i?eia?a,
anee q>24 in, oi -> FCFS.) I?e i/aiue iaeuo cia/aieyo a?aiaiiiai eaaioa
Round Robin no?aoaaey iacuaatho ?acaeaeaieai i?ioeanni?a — processor
sharing. Oai?aoe/anee yoi icia/aao, /oi eaaeaeue ec N i?ioeannia
?aaioaao ni naiei nianoaaiiui i?ioeanni?ii, i?iecaiaeeoaeueiinoue
i?ioeanni?a ?aaia 1/N io i?iecaiaeeoaeueiinoe oece/aneiai i?ioeanni?a.

2.2.5. IEAIE?IAAIEA n eniieueciaaieai iiiaio?iaiaaie
i/a?aaee.(Multilevel queue scheduling)

Yoa no?aoaaey ?ac?aaioaia aeey neooaoeee, eiaaea i?ioeannu iiaoo auoue
eaaei eeanneoeoee?iaaiu ia ianeieueei a?oii, iai?eia?, /anoi i?ioeannu
?acaeaeytho ia aeaa a?oiiu: eioa?aeoeaiua (i?ioeannu ia?aaeiaai ieaia) e
iaeaoiua (oiiiaua).

Eioa?aeoeaiua e iaeaoiua i?ioeannu eiatho ?acee/iua o?aaiaaiey e
e?aoein?i/iiio ieaie?iaueeo, iai?eia? ii ioiioaieth ei a?aiaie ioeeeea.

No?aoaaey iiiaio?iaiaaie i/a?aaee ?acaeaeyao i/a?aaeue aioiauo
i?ioeannia ia ianeieueei i/a?aaeae, a eaaeaeie ec eioi?uo iaoiaeyony
i?ioeannu n iaeeiaeiauie naienoaaie, e eaaeaeue ec eioi?uo iiaeao
ieaie?iaaoueny eiaeeaeaeoaeueiie no?aoaaeae, iai?eia? Round Robin
no?aoaaey aeey eioa?aeoeaiuo i?ioeannia e FCFS aeey iaeaoiuo i?ioeannia.

Acaeiiaeaenoaea i/a?aaeae inouanoaeyaony ii neaaeothuei i?aaeeai: ie
iaeei i?ioeann n aieaa ieceei i?ei?eoaoii ia iiaeao auoue caiouai, iiea
ia auiieiyony i?ioeannu ai anao i/a?aaeyo n aieaa aunieei i?ei?eoaoii.

?aaioa i?ioeanna ec i/a?aaee n aieaa ieceei i?ei?eoaoii iiaeao auoue
i?einoaiiaeaia, anee a iaeiie ec i/a?aaeae n aieaa aunieei i?ei?eoaoii
iiyaeeny i?ioeann.

2.2.6. I?ia?aiie?iaaiea n eniieueciaaieai iiiaio?iaiaaie i/a?aaee n
ia?aoiuie naycyie (multilevel feedback queue sheduling)

Iau/iay iiiaio?iaiaaay i/a?aaeue ia aeiioneaao ia?aiauaiey i?ioeannia
iaaeaeo i/a?aaeyie. Iiiaio?iaiaaay i/a?aaeue n ia?aoiuie naycyie
i?aaeiieaaaao, /oi i?ioeannu i?e ii?aaeaeaiiuo oneiaeyo iiaoo
ia?aiauaoueny iaaeaeo i/a?aaeyie.

I?ioeannu ia?aiia/aeueii iiiaaeatho a i/a?aaeue 0, aaea eaaeaeiio ec
ieo i?aaeinoaaeyaony eaaio a?aiaie, ?aaiue 8 in. Oa i?ioeannu, eioi?ua
ia oniaee auiieieoueny a oa/aiea yoiai a?aiaie, ia?aiauathony a
i/a?aaeue 1. I?ioeannu ec i/a?aaee 1 ia/eiatho ia?aaaouaaoueny oieueei
oiaaea, eiaaea i/a?aaeue 0 noaiiaeoueny ionoie. Oa i?ioeannu, eioi?ua ia
auiieieeenue a i/a?aaee 1 (q=16 in) ia?aiauathony a i/a?aaeue 2.
I?ioeannu ec i/a?aaee 2 aoaeoo ia?aaaouaaoueny oieueei a oii neo/aa,
anee noaiiayony ionouie i/a?aaee 0 e 1.

?anniio?aiiay no?aoaaey yaeyaony iaeaieaa oieaa?naeueiie e ni/aoaao a
naaa naienoaa anao ?anniio?aiiuo ?aiueoa no?aoaaee.

FCFS

SJF

i?ei?eoaoiay

Round Robin

iiiaio?iaiaaay i/a?aaeue

3. Oi?aaeaiea iaae?ooaeueiie iaiyoueth.

3.1. Naiiieia. (swapping)

Naiiieiaii iacuaaaony iaoiae oi?aaeaiey iaiyoueth, iniiaaiiue ia oii,
/oi ana i?ioeannu, o/anoaothuea a ioeueoei?ia?aiiiie ia?aaioea, o?aiyony
ai aiaoiae iaiyoe.

I?ioeann, eioi?iio auaeaeai CPU, a?aiaiii ia?aiauaaony a iniiaioth
iaiyoue (swap in/roll in).

A neo/aa i?a?uaaiey ?aaiou i?ioeanna ii ia?aiauaaony ia?aoii ai
aiaoithth iaiyoue (swap out/roll out).

Caia/aiea: i?e naiiieiaa ec iniiaiie iaiyoe ai aiaoithth (e ia?aoii)
ia?aiauaaony any i?ia?aiia, a ia a? ioaeaeueiay /anoue.

Naiiieia eiiaaea eniieuecotho i?e i?ei?eoaoiii ieaie?iaaiee CPU. A yoii
neo/aa n oeaeueth inaiaiaeaeaiey iaiyoe aeey aunieii?ei?eoaoiuo
i?ioeannia, ieceii?ei?eoaoiua i?ioeannu ia?aiauathony ai aiaoithth
iaiyoue.

Iniiaiia i?eiaiaiea naiiieia iaoiaeeo a nenoaiao ?acaeaeaiey a?aiaie,
aaea ii eniieuecoaony iaeiia?aiaiii n Round Robin no?aoaaeae
ieaie?iaaiey CPU.

A ia/aea eaaeaeiai a?aiaiiiai eaaioa aeie oi?aaeaiey iaiyoueth
aua?oaeaao ec iniiaiie iaiyoe i?ioeann, ?aaioa eioi?iai auea oieueei /oi
i?a?aaia, e caa?oaeaao i/a?aaeiie auiieiaiiue i?ioeann.

Iaoiae naiiieiaa aeeyao ia aaee/eio a?aiaiiiai eaaioa Round Robin
no?aoaaee.

I?eia?.

ionoue i/a?aaeiie caa?oaeaaiue a iaiyoue i?ioeann eiaao ?acia? 100Ea.

aeene iicaieyao /eoaoue aeaiiua ni nei?inoueth 1 Ia a naeoiaeo

neaaeiaaoaeueii, 100 Ea iiaoo auoue caa?oaeaiu ca 100 in.

aoaeai n/eoaoue, /oi aeey ia?aiia/aeueiiai iiaeaiaea aieiaee /oaiey –
caiene iio?aaoaony 8 in

oaeei ia?acii, iia?aoeey naiiieia caeiao 108 in, a iauaa a?aiy naiiieiaa
– 216 in.

Aeey yooaeoeaiie caa?oaeaiiinoe i?ioeanni?a a?aiy naiiieiaa aeieaeii
auoue nouanoaaiii iaiueoa a?aiaie n/aoa. Neaaeiaaoaeueii, aeey
?anniio?aiiiai i?eia?a eaaio a?aiaie aeieaeai auoue nouanoaaiii aieueoa,
/ai 216 in. ssnii, /oi yoi /enei cia/eoaeueii oaaee/eony, anee
ia?aiauaaiue i?ioeann eiaao ?acia?, iai?eia?, 1 Ia.

Iaaeinoaoie “/enoiai” naiiieiaa a aieueoeo iioa?yo a?aiaie ia caa?oceo
eee aua?oceo i?ioeannia. Iiyoiio a nia?aiaiiuo iia?aoeeiiiuo nenoaiao
eniieuecoaony iiaeeoeoee?iaaiiua aa?eaiou naiiieiaa.

Oae, iai?eia?, ai iiiaeo aa?neyo iia?aoeeiiiie nenoaiu UNIX naiiieia
aeeth/aaony oieueei a oii neo/aa, eiaaea eiee/anoai i?ioeannia a iaiyoe
noaiiaeony neeoeii aieueoei.

3.2. Niaaeiia ?aciauaiea i?ioeannia.

Iaoiaeu ?aciauaiey i?ioeannia a iniiaiie iaiyoe ii ioiioaieth e
?aniieiaeaieth o/anoeia iaiyoe, auaeaeaiiuo aeey iaeiie e oie aea
i?ia?aiiu aeaeyo ia aeaa eeanna. Ia?aue — iaoiae niaaeiiai ?aciauaiey, a
aoi?ie — iaoiae ianiaaeiiai ?aciauaiey.

Niaaeiia ?aciauaiea yaeyaony i?inoaeoei e i?aaeiieaaaao, /oi a iaiyoe,
ia/eiay n iaeioi?iai ia/aeueiiai aae?ana auaeaeyaony iaeei iai?a?uaiue
o/anoie aae?aniiai i?ino?ainoaa.

i?e ianiaaeiii ?aciauaiee i?ia?aiia ?acaeaaaony ia iiiaeanoai /anoae,
eioi?ua ?aniieaaathony a ?acee/iuo, iaiaycaoaeueii niaaeiuo o/anoeao
aae?aniiai i?ino?ainoaa.

3.2.1. Iaeiii?ia?aiiiue ?aaeei.

?enoiie eeethno?e?oao niaaeiia ?aciauaiea (contiguous allocation)
iaeiie i?ia?aiiu a iniiaiie iaiyoe.

I?e niaaeiii ?aciauaiee ?acia? caa?oaeaaiie i?ia?aiiu ia?aie/eaaaony
?acia?ii iaeiieoaey. Aeey oiai, /oiau i?e niaaeiii ?aciauaiee
caa?oaeaoue i?ia?aiiu, ?acia?u eioi?uo i?aauoatho ?acia?u iaeiieoaey,
eniieuecotho iaoiae iaa?eaeiuo naaiaioia (overlay segments).

A i?ia?aiia, eiathuae ae?aaiaeaeioth no?oeoo?o, iiaeoee aoi?iai o?iaiy
?aaioatho noaoai iineaaeiaaoaeueii, iiyoiio a iaiyoe iiaeao iaoiaeeoueny
oieueei iaeei ec ieo.

Iaa?eaeioth no?oeoo?o i?ia?aiiu e iineaaeiaaoaeueiinoue caa?ocee
iaa?eaeiuo naaiaioia ieaie?oao nai i?ia?aiieno.

A i?ioeanna auiieiaiey i?ia?aiiu ana a? aae?ana ia aeieaeiu auoue
iaiueoa /enea a. A i?ioeaiii neo/aa aiciiaeia caienue eaeiai-eeai
?acoeueoaoa ?aaiou i?ia?aiiu (iiaa?o iia?aoeeiiiie nenoaiu) e
oie/oiaeaiea iaeioi?uo a? /anoae. Caueoo iia?aoeeiiiie nenoaiu a neo/aa
niaaeiiai ?aciauaiey i?e iaeiii?ia?aiiiii ?aaeeia iiaeii inouanoaeoue n
iiiiuueth ?aaeno?a a?aieoeu.

Ai a?aiy ?aaiou i?eeeaaeiie i?ia?aiiu ana aae?ana, aaia?e?oaiua CPU,
n?aaieaathony n niaea?aeeiui ?aaeno?a a?aieoeu. Anee aaia?e?oaony aae?an
iaiueoa /enea a, ?aaioa i?ia?aiiu i?a?uaaaony.

3.2.2 Ioeueoei?ia?aiiiue ?aaeei n OEENE?IAAIIUIE a?aieoeaie.

Ioeueoei?ia?aiie?iaaiea n oeene?iaaiiuie ?acaeaeaie (Multiprogramming
with a fixed number of tasks) i?aaeiieaaaao ?acaeaeaiea aae?aniiai
i?ino?ainoaa ia ?yae ?acaeaeia oeene?iaaiiiai ?acaeaea. A eaaeaeii
?acaeaea ?aciauaaony iaeei i?ioeann.

Iaeaieaa i?inoie e iaeiaiaa yooaeoeaiue ?aaeei MFT niioaaonoaoao
neo/ath, eiaaea o?aineyoeey i?ia?aii inouanoaeyaony a aaniethoiuo
aae?anao aeey niioaaonoaothuaai ?acaeaea.

A yoii neo/aa, anee niioaaonoaothuee ?acaeae caiyo, oi i?ioeann
inoaaony a i/a?aaee ai aiaoiae iaiyoe aeaaea a oii neo/aa, eiaaea
ae?oaea ?acaeaeu naiaiaeiu.

Oiaiueoeoue o?aaiaioaoeeth i?e ioeueoei?ia?aiie?iaaiee n oeene?iaaiiuie
?acaeaeaie iiaeii, anee caa?oci/iua iiaeoee iieo/aoue a ia?aiauaaiuo
aae?anao. Oaeie iiaeoeue iiaeao auoue caa?oaeai a ethaie naiaiaeiue
?acaeae iinea niioaaonoaothuae iano?ieee.

I?e ioeueoei?ia?aiie?iaaiee n o?aineyoeeae a ia?aiauaaiuo aae?anao
eiathony aeaa i?e/eiu o?aaiaioaoeee. Ia?aay — ?acia? caa?oaeaiiiai
i?ioeanna iaiueoa ?acia?a, caieiaaiiai ?acaeaeii (aioo?aiiyy
o?aaiaioaoeey), aoi?ay — ?acia? i?ioeanna a i/a?aaee aieueoa ?acia?a
naiaiaeiiai ?acaeaea, e yoio ?acaeae inoaaony naiaiaeiui (aiaoiyy
o?aaiaioaoeey).

Aeey caueou iaiyoe i?e ioeueoei?ia?aiie?iaaiee n oeene?iaaiiui
?acaeaeaie iaiaoiaeeiu aeaa ?aaeno?a. Ia?aue — ?aaeno? aa?oiae a?aieoeu
(iaeiaiueoee aae?an), aoi?ie — ?aaeno? ieaeiae a?aieoeu (iaeaieueoee
aae?an).

I?aaeaea /ai i?ia?aiia a ?acaeaea N ia/iao auiieiyoueny, aa a?aie/iua
aae?ana caa?oaeathony a niioaaonoaothuea ?aaeno?u. A i?ioeanna ?aaiou
i?ia?aiiu ana oi?ie?oaiua ath aae?ana eiio?iee?othony ia oaeiaeaoai?aiea
ia?aaainoaa

a

Нашли опечатку? Выделите и нажмите CTRL+Enter

Похожие документы
Обсуждение

Оставить комментарий

avatar
  Подписаться  
Уведомление о
Заказать реферат!
UkrReferat.com. Всі права захищені. 2000-2019