操作系统英文版课后习题答案整理.doc
- 文档编号:152874
- 上传时间:2022-10-04
- 格式:DOC
- 页数:14
- 大小:1.19MB
操作系统英文版课后习题答案整理.doc
《操作系统英文版课后习题答案整理.doc》由会员分享,可在线阅读,更多相关《操作系统英文版课后习题答案整理.doc(14页珍藏版)》请在冰豆网上搜索。
14
OSExerciseBook
ClassNo.Name
1.1Whatarethethreemainpurposesofanoperatingsystem?
(1)Interfacebetweenthehardwareanduser;
(2)managetheresourceofhardwareandsoftware;
(3)abstractionofresource;
1.2Listthefourstepsthatarenecessarytorunaprogramonacompletelydedicatedmachine.
Preprocessing>Processing>Linking>Executing.
1.6Definetheessentialpropertiesofthefollowingtypesofoperatingsystems:
a.Batch
b.Interactive
c.Timesharing
d.Realtime
e.Network
f.Distributed
1.7Wehavestressedtheneedforanoperatingsystemtomakeefficientuseofthecomputing
hardware.Whenisitappropriatefortheoperatingsystemtoforsakethisprincipleandto“waste”resources?
Whyissuchasystemnotreallywasteful?
2.2Howdoesthedistinctionbetweenmonitormodeandusermodefunctionasarudimentary
formofprotection(security)system?
2.3Whatarethedifferencesbetweenatrapandaninterrupt?
Whatistheuseofeachfunction?
2.5Whichofthefollowinginstructionsshouldbeprivileged?
a.Setvalueoftimer.
b.Readtheclock.
c.Clearmemory.
d.Turnoffinterrupts.
e.Switchfromusertomonitormode.
2.8Protectingtheoperatingsystemiscrucialtoensuringthatthecomputersystemoperates
correctly.Provisionofthisprotectionisthereasonbehinddual-modeoperation,memory
protection,andthetimer.Toallowmaximumflexibility,however,wewouldalsoliketo
placeminimalconstraintsontheuser.
Thefollowingisalistofoperationsthatarenormallyprotected.Whatistheminimalset
ofinstructionsthatmustbeprotected?
a.Changetousermode.
b.Changetomonitormode.
c.Readfrommonitormemory.
d.Writeintomonitormemory.
e.Fetchaninstructionfrommonitormemory.
f.Turnontimerinterrupt.
g.Turnofftimerinterrupt.
3.6Listfiveservicesprovidedbyanoperatingsystem.Explainhoweachprovidesconveniencetotheusers.Explainalsoinwhichcasesitwouldbeimpossibleforuser-levelprogramstoprovidetheseservices.
3.7Whatisthepurposeofsystemcalls?
3.10Whatisthepurposeofsystemprograms?
4.1MS-DOSprovidednomeansofconcurrentprocessing.Discussthreemajorcomplications
thatconcurrentprocessingaddstoanoperatingsystem.
4.6Thecorrectproducer–consumeralgorithminSection4.4allowsonlyn-1bufferstobe
fullatanyonetime.Modifythealgorithmtoallowallbufferstobeutilizedfully.
5.1Providetwoprogrammingexamplesofmultithreadinggivingimproveperformanceover
asingle-threadedsolution.
5.3Whataretwodifferencesbetweenuser-levelthreadsandkernel-levelthreads?
Underwhatcircumstancesisonetypebetterthantheother?
6.3Considerthefollowingsetofprocesses,withthelengthoftheCPU-bursttimegivenin
milliseconds:
Process Burst TimePriority
P1 10 3
P2 1 1
P3 2 3
P4 1 4
P5 5 2
TheprocessesareassumedtohavearrivedintheorderP1,P2,P3,P4,P5,allattime0.
a.DrawfourGanttchartsillustratingtheexecutionoftheseprocessesusingFCFS,SJF,anonpreemptivepriority(asmallerprioritynumberimpliesahigherpriority),andRR
(quantum=1)scheduling.
b.Whatistheturnaroundtimeofeachprocessforeachoftheschedulingalgorithmsin
parta?
c.Whatisthewaitingtimeofeachprocessforeachoftheschedulingalgorithmsinpart
a?
d.Whichoftheschedulesinpartaresultsintheminimalaveragewaitingtime(overall
processes)?
Answer:
6.4Supposethatthefollowingprocessesarriveforexecutionatthetimesindicated.Each
processwillrunthelistedamountoftime.Inansweringthequestions,usenonpreemptive
schedulingandbasealldecisionsontheinformationyouhaveatthetimethedecision
mustbemade.
a.WhatistheaverageturnaroundtimefortheseprocesseswiththeFCFSscheduling
algorithm?
b.WhatistheaverageturnaroundtimefortheseprocesseswiththeSJFschedulingalgorithm?
c.TheSJFalgorithmissupposedtoimproveperformance,butnoticethatwechoseto
runprocessP1attime0becausewedidnotknowthattwoshorterprocesseswould
arrivesoon.ComputewhattheaverageturnaroundtimewillbeiftheCPUisleft
idleforthefirst1unitandthenSJFschedulingisused.RememberthatprocessesP1
andP2arewaitingduringthisidletime,sotheirwaitingtimemayincrease.This
algorithmcouldbeknownasfuture-knowledgescheduling.
6.10Explainthedifferencesinthedegreetowhichthefollowingschedulingalgorithmsdiscriminateinfavorofshortprocesses:
a.FCFS
b.RR
c.Multilevelfeedbackqueues
7.7Showthat,ifthewaitandsignaloperationsarenotexecutedatomically,
thenmutualexclusionmaybeviolated.
7.8TheSleeping-BarberProblem.
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 操作系统 英文 课后 习题 答案 整理