版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
操作系统期中作业(答案)PAGEPAGE3操作系统期中作业姓名:___学号:专业:一、Foreachofthefollowingstatements,ChoosingTrueorFalseBinarysemaphoresarethosethatareusedbynomorethantwothreads.FTheBanker'salgorithmisawayofpreventingdeadlock.FAmulti-levelindexedfilepermitsfasterrandomaccessthanacontiguouslyallocatedfile.FAnatomicoperationisamachineinstructionorasequenceofinstructionsthatmustbeexecutedtocompletionwithoutinterruption.TDeadlockisasituationinwhichtwoormoreprocesses(orthreads)arewaitingforaneventthatwilloccurinthefuture.FStarvationisasituationinwhichaprocessisdeniedaccesstoaresourcebecauseofthecompetitiveactivityofother,possiblyunrelated,processes.TWhileaprocessisblockedonasemaphore'squeue,itisengagedinbusywaiting.FMutualexclusioncanbeenforcedwithageneralsemaphorewhoseinitialvalueisgreaterthan1.FAprinterisanexampleofalogicalresource.FVersionsofOS/360arestillwidelyusedtoday.FWhenanexecutingprocessisstoppedbythescheduler,itissaidtobeblocked.FInterruptsareusedtoachieveatypicaltimesharingOS.T二、MultipleChoiceQuestionsForeachofthefollowingquestions,Thereisonlyonecorrectanswer.Whatisthepurposeofsystemcalls?a)Systemcallsallowuser-levelprocessestogainresourcesfromtheoperatingsystem.b)Systemcallsarethestandardinterfacebetweenauserprocessandakernelprocess.c)Systemcallsallowuser-levelprocessestorequestservicesoftheoperatingsystem.d)Thereisnorealpurposetosystemcalls.Threadsbelongingtothesameprocesssharethea)stack b)datasectionc)registerset d)threadIDInMany-to-Onethreadmodel,Whatwouldhappenifathreadinamultithreadedprocessmakesablockingsystemcall?a)theotherthreadsoftheprocesswouldcontinuetorunb)theentireprocesswouldgetblockedc)theblockingthreadwillgetkilledd)theblockingthreadwillnevergettorunagainWhichofthefollowingOperatingsystemsusespreemptivescheduling?a)MacOS8 b)Windows3.xc)Windows2000 d)DOS6.0Ameasureofthenumberofprocessescompletedpertimeunitiscalleda)throughput b)waitingtimec)responsetime d)CPUutilizationOneoftheproblemswithpriorityschedulingisa)aging b)starvationc)processdeath d)averagewaitingtimeInatime-sharingsystem,whichofthefollowingisthebestcriterionforCPUscheduling.a)MinimizeCPUutilization b)MaximizeCPUutilizationc)Maximizesystemthroughput d)Minimizeresponsetime.TheinitialvalueofsemaphoreSis2.ifthevalueis-1atpresent,howmanyprocessesareblockedonthissemaphore.a)1b)2c)3d)4Asystemisinadeadlock,ifitsresourceallocationgrapha)containsacycle b)doesn’tcontainacyclec)containsacycleandthereisjustoneinstanceofeveryresourced)hasatleastoneoutgoingedgefromanyoneoftheprocessnodesPreemptionofresourcescanbeenforcedtopreventoccurrenceofdeadlocks,butthiscan’tbeappliedtoalltheresourcetypes,aspreemptionmightleavetheresourceinanundeterminedstate.Whichofthefollowingresourcescan’thencebepreempted?a)CPUregisters b)memoryspacec)tapedrive d)alloftheaboveAsystemissaidtobe___________ifitcancontinuetofunctionevenwhenanodeornodesinthesystemfail.a)networked b)distributedc)realtime d)fault-tolerantWhichofthefollowingactivityneedsnospecialhardwaresupport?a)Processscheduling b)timermanagementc)memorymapping d)interruptsystemWhichofthefollowingstatementaboutprocessesisincorrect?a)Aprocessisdynamic.b)Aprocesshasalifetime.c)Aprocessisasetofinstructions.d)Multipleprocessesmayexecuteconcurrently.三、Considerthefollowingsetofprocesses:ProcessBurst-TimePriorityP1 15 4P2 3 8P3 7 5P4 5 2P5 1 6P6 2 6TheprocessesareassumedtohavearrivedintheorderP1,P2,P3,P4,P5,P6,allattime0.UseFCFS,SJF,RoundRobin(quantumis2),Priority(lownumbershavehighpriority).Foreachofthealgorithms:1DrawaGanttchart2.Whatistheaveragewaitingtimeforeachoftheschedulingalgorithms?3.Whatistheaverageturnaroundtimeforeachoftheschedulingalgorithms?Answer:FCFS: P1P2P3P4P5P6151825303133AWT=(0+15+18+25+30+31)/6=19.83ATT=(15+18+25+30+31+33)/6=25.33SJF:P5P6P2P4P3P1AWT=(18+3+11+6+0+1)/6=6.5ATT=(33+6+18+11+1+3)/6=12Round-Robin(quantum=2):P1P2P3P4P5P6P1P2P3P4P1P3P4P1P3P1AWT=(18+11+19+8+9)/6=13.83ATT=(33+14+26+23+9+11)/6=19.33Priority:P4P1P3P5P6P2AWT=(5+30+20+0+27+28)/6=18.33ATT=(20+33+27+5+28+30)/6=23.83Twoconcurrentprocesseshaveinput,computingandprintingactions,respectively.ThatissaidI1,C1,P1forthe1stprocess,andI2,C2,P2forthe2ndprocess.Theirprecedentialrelationshipisshowninthefigure,i.e.I2musthappenafterI1,C2musthappenafterC1andI2,etc.Pleasedescribethesynchronizationrelationshipoftwoprocessesbymeansofsemaphoresandrelatedwait/signaloperations.I1I1I2C1C2P1P2Semaphore:s1,s2,s3:=0;P1: P2: { { I1; wait(s1); signal(s1); I2 C1; wait(s2);signal(s2); C2 ;P1; wait(s3);signal(s3); P2;} }五、TherearethreecooperativeprocessesP1,P2,andP3.Theyreaddata,denotedasa、bandc,fromthesameinputdevice,asshowninfigurebelow.Theinputdeviceisanexclusiveaccessdevice.Thefirstdatum(a)mustbereadbyprocessP1,theseconddatum(b)isreadbyprocessP2,andthethirddatum(c)
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 《机构老年人社工实务》课程期末考试(A)卷
- 吉林艺术学院《影视鉴赏》2021-2022学年第一学期期末试卷
- 吉林艺术学院《视唱Ⅲ》2021-2022学年第一学期期末试卷
- 资产公司垫资协议书范本模板
- 吉林艺术学院《材料研究》2021-2022学年第一学期期末试卷
- 吉林师范大学《知识产权法》2021-2022学年第一学期期末试卷
- 2022年江苏省公务员录用考试《行测》真题(C类)及答案解析
- 2024年大米原材料供应合同范本
- 《供应链管理》教案 张静芳 第7章 供应链运输管理;第8章 供应链数字协同
- 黄金提纯厂合作协议书范文范本
- 校园设施规划设计案例分析
- 后勤食堂食材供应商考察评价流程
- 建筑施工安全员培训
- 普通高中生招生计划书
- 2024年山东省港口集团有限公司招聘笔试参考题库含答案解析
- 汉语拼音课件趣味拼音
- 《物理气相沉积》课件
- 双拥工作策划方案
- 药事管理与法规-暨南大学中国大学mooc课后章节答案期末考试题库2023年
- 高端矿泉水项目融资计划书
- 2023建筑业10项新技术
评论
0/150
提交评论