Ex3Word文档下载推荐.docx

上传人:b****5 文档编号:17571262 上传时间:2022-12-07 格式:DOCX 页数:9 大小:139.66KB
下载 相关 举报
Ex3Word文档下载推荐.docx_第1页
第1页 / 共9页
Ex3Word文档下载推荐.docx_第2页
第2页 / 共9页
Ex3Word文档下载推荐.docx_第3页
第3页 / 共9页
Ex3Word文档下载推荐.docx_第4页
第4页 / 共9页
Ex3Word文档下载推荐.docx_第5页
第5页 / 共9页
点击查看更多>>
下载资源
资源描述

Ex3Word文档下载推荐.docx

《Ex3Word文档下载推荐.docx》由会员分享,可在线阅读,更多相关《Ex3Word文档下载推荐.docx(9页珍藏版)》请在冰豆网上搜索。

Ex3Word文档下载推荐.docx

d.Whatisathread?

Neweroperatingsystemsprovidethreadswhichallliveinthesameaddressspaceandsharetheirfiledescriptors.Thethreadcanbedefinedasaseparatestreamofexecutionthattakesplacesimultaneouslywithandindependentlyofeverythingelsethatmightbehappening.

e.Whyarethreadsuseful?

Firstly,itspendslesstimetocreateanewthreadthanaprocesswiththereasonthatthenewlycreatedthreadonlyusesthecurrentprocessaddressspace,buttheprocessnot.

Secondly,itisquickertoendathreadthanaprocess.Becausethethreadsoccurinthesamecurrentprocessaddress,soitisquickertoswitchbetweenthreadsthanprocesses.

Thirdly,forthesamereasonmentionedabove,thedatawhichareproducedbyonethreadcanbesharedbyanotherthreadimmediately,alsomuchfasterthanprocesses.

NowletustryusingtheTimestampprogramandruntwothreads.

Right-clickonTimestamp.exeandsaveprogramindriveC.ThisprogramshouldbeexecutedintheWindowscommandconsole.OpentheWindowscommandconsolebyclickingontheStartmenuondesktop,andthenselectRun...Type"

cmd"

inthetextfieldandclickOK.AtthepromptC:

\,type"

Timestamp–i500000–p2>

Output.out"

;

pressENTER.

Note:

-ispecifiesthenumberofworkcycles,and-pspecifiesthenumberofthreadstorun.

Nowusethegraphicalinterfacetoseetheoutput.

Right-clickonGraph.exeandsavetheprograminDriveC.Opentheprogram.IfGraph.exedoesnotrun,refertoAppendixA.RunningaVisualBasicFileforinstructions.OnceGraph.exeisopened,clickSelectDataFile,andchoosethefileOutput.outindriveC.

Notethatthehorizontalaxisisthenumberofworkcycles.Eachthreadisdistinguishedbyadifferentcolor.Thegrayareasindicatethatthesystemisnotrunningthegiventhreads.Alegendforthethreadsisdisplayedatthebottomofthegraph.

f.Captureascreenshotofthegraphicaloutput.

g.Listtheorderinwhichthethreadsarebeingexecuted.

1-1-2-2-1-1-2

h.Whatisacontextswitch?

Howdoyouknowacontextswitchoccurredfromthegraph?

WhenswitchingtheCPUtoanotherprocessrequiressavingthestateoftheoldprocessandloadingthesavedstateforthenewprocess,whichisknownasacontextswitch.Acontextusuallyoccurswhenaninterruptappearsonthescreen.

i.Whatactivitiesareperformedbytheprocessorduringacontextswitch?

AninterruptoccursanditwilldosomethingtomakingnotesoftheaddressofthelastinstructionexecutedandthenswitchCPUtoanotherprocess.

j.Explainwhatishappeningintermsofpreemptivemultitaskingandwhateffectithastotheuser.

Theprocessorcanassigndifferentprioritiestodifferenttypesofinterrupts.Thelow-speeddeviceshavelowpriorityandthehigh-speeddeviceshavehighpriority.Thehighprioritydevicescaninterruptthelowprioritydevicesbutthelowprioritydevicescan’tinterruptthehighprioritydevices.

k.Aninterruptindicatesthatthethreadisnotbeingrunandshouldthereforebefollowedbyagraygap.Howdoesthekernelhandleaninterrupt?

Atfirst,theinputdevicesendstotheprocessoranIRQ.WhentheprocessorreceivesthissignalofIRQ,itstopsexecutingtheapplicationprogram,makingnotesoftheaddressofthelastinstructionexecuted.Then,itswitchestotheaddressoftheinterrupthandy,andstartsexecutingtheinstructionswhereitfinds.

Tryusingmorethantwothreads.

AttheWindowscommandpromptC:

\,type“Timestamp–i500000–p[enterthenumberofthreadstorun(lessthan10)]”andpressENTER.

l.Copyandpastethegraphicaloutput.

m.Listtheorderinwhichthethreadsarebeingexecuted.

1-2-1-1-2-3-4-4-5-5-5-3-4-4-5-6-7-7-8-6-7-8-9

n.Considerasetofthreeprocessesthatareexecutedtocompletion.ProcessAtakes6seconds,ProcessBtakes3seconds,andProcessCtakes5seconds.Abouthowlongwouldittakeforalltheprocessestobecompletedusingpreemptivemultitasking,morethan14seconds,lessthan14seconds,orexactly14seconds?

Explainyouranswer.

Morethan14seconds,becausethecontextswitchesalsocosttimes

Nowinvestigateyourownsystem.

o.HowmuchRAM(mainmemory)doesyourmachinehave?

Showproofofyouranswerbysubmittingascreenshotofthedisplayfromwhichyouinferredyouranswer.

512M

LaunchMicrosoftWordifitisnotalreadylaunched.

p.HowmanythreadsdoesMicrosoftWordlaunch?

(Referto3.1.4Lab:

TheTaskManager.)Showproofofyouranswerbysubmittingascreenshotofthedisplayfromwhichyouinferredyouranswer.

10

q.HowmuchmemorydoesMicrosoftWordconsume?

Showproofofyouranswerbysubmittingascreenshotofthedisplayfromwhichyouinferredyouranswer.

27368KB

Question2.VirtualMemory

Inthissection,youwilluseaprogramdemonstratinghowvirtualmemoryisused.

a.Howdoesvirtualmemoryworkusingapagetable?

Wheninvirtualmemory,everyaddresscanbetranslatedintoaphysicalmemoryaddressbyapagetable.Foreverypageinthevirtualaddressspace,thepagetablegivestherealaddressinRAMwherethepageislocated.

b.Whatistheprimarypurposeofvirtualmemory?

Itcan“add”thestorageofthememorywhichmeanstheprogramcanbelocatedflexibly.

c.Listthreeadvantagesofusingvirtualmemorywhenexecutingaprogram.

Firstly,theaddressspacetheprocessesassigncanactuallybe“larger”thanthephysicalmemoryavailable.

Secondly,inasystemthatusesvirtualmemory,everyprogramrunsinitsownprivateaddressspace.

Thirdly,usingthevirtualmemoryscheme,asmallamountofRAMisrequiredforaprogramtorun,andtherestoftheprogramsaddressspaceiskeptonthedisk

ExecutethePageReplacementSimulationprogram.

ClickonPaging.exetoruntheapplication.RefertoAppendixA.RunningaVisualBasicFileifPaging.exedoesnotrun.

Noticethetopoftheprogramwindowindicatesthenumberofrequestandtotalpagefaults.ThetableontheleftrepresentsRAMandtheoneontherightrepresentstheharddisk.Theorderofrequestsissetatdefault.Youcanalsoenteryourownorderofrequests.Tochangethespeedofthesimulation,youcanusethespeedadjusteratthebottom-leftoftheprogramwindow.EachtimeyouclickonStoporPause,thesimulationendsafteronecompletememoryaccess.

Starttheprogramusingthedefaultqueueofrequests.

d.Describewhatishappeningforthefirstsevenrequestsstep-by-stepforthedefaultorderofrequests.

Therearefivepagefaults,whichmeansfourrequestsisinvirtualmemory.Atfirst,thecomputerstaketherequesttoRAMandthensendittoCPU.

e.Whendoesapagefaultoccur,andhowdoesthekernelhandleapagefault?

TheaddresstranslationcircuitrychecksthepagetablebutfindsthepageisnotinRAM,soitstartsapagefault(aninterrupt).Thentheprocessorstopsexecutingtheuserprogramandswitchthecontroltothekernel.Thekernellooksatcertainstatusregisterstomakeclearthatwherethepagefaultcamefromandknowtheprocesswantsaccesstoitsvirtualpage,soitwillgiveRAMandloadinthepagefortheprogram.Afterthatitwillfixupdatethepagetable.Afterawhile,controlwillbereturnedtotheuserprogram.

f.Enterasequenceofeightrequestsinplaceofthedefaultorderofrequestsintheprogramthatwouldcausefourpagefaults.

1,2,3,4,1,2,3,4

g.Inwhatcaseisitundesirabletousevirtualmemory?

Thespeedmaybecomeverylow.

h.Givenatotalpagingfilesizeof267MB,andaRAMofsize256MB.Yourapplicationsarecurrentlytakingup500MBofmemory.Howwouldyourunanapplicationthatconsumes100MBofmemory?

Wecanexpandthevirtualmemory.

Question3.Troubleshooting

Belowarevariousproblemscenarios.Selectthemostlikelycause(s)fortheproblemfromtheCauseslist.

Causes

A.Componentnotpluggedin

B.Applicationsoftwareerror

C.Operatingsystemerror

D.LowRAM

E.Slowprocessor

F.CMOSbatteryfailure

G.Motherboardfailure

H.Harddiskfailure

I.BIOSROMfailure

J.Appropriatecomponentdrivernotinstalledproperly

Problems

a.Programnotresponding

Causes:

D.LowRAMorE.Slowprocessor

b.Screenfrozeaftersuccessfullybooting

C.Operatingsystemerror

c.Programsrunningslowly

d.Peripheraldevicenotworking(mouse,keyboard,printer)

A.ComponentnotpluggedinorJ.Appropriatecomponentdrivernotinstalledproperly

e.Allnecessarycomputersystemcomponentsarepluggedin,butthesystemdoesnotboot

F.CMOSbatteryfailureorG.MotherboardfailureorI.BIOSROMfailure.

f.Thecomputerisbeingbooted,andanerrormessageindicatesthattheharddrivecannotbefound.

H.Harddiskfailure

g.Iflowmemoryisacauseofthesystemrunningslowly,whatcanyoudoasausertospeedupthesystem?

Expandingthestorageofthemainmemoryandthevirtualmemory,whichIthinkisthemostimportant.

Question4.FileDirectories

Inthisquestion,youaregivenazipfile,whichcontainssomefoldersandfiles.Youwillunzipthegivenfile,manipulatethefilesandfolders

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 农林牧渔 > 农学

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1