计算机专业毕业论文文献翻译资料.docx
- 文档编号:14160275
- 上传时间:2023-06-21
- 格式:DOCX
- 页数:10
- 大小:21.11KB
计算机专业毕业论文文献翻译资料.docx
《计算机专业毕业论文文献翻译资料.docx》由会员分享,可在线阅读,更多相关《计算机专业毕业论文文献翻译资料.docx(10页珍藏版)》请在冰点文库上搜索。
计算机专业毕业论文文献翻译资料
计算机专业毕业论文文献翻译资料
附录一
Comparedtomulti-threadedoperatingsystem,meansisthatitcanrunaprogramwith
theabilityofdifferentparts;eachpartoftheimplementationwasasathread.Therefore,inthepreparationofapplications,wehaveverygooddesigninordertoavoidtheimplementationofthedifferentthreadsofmutualinterference.Whichwillhelpustodesignrobustprocedures,wecanmakeatanytimewhennecessarytoaddthethread.
Threadcanbedescribedasamicro-process;ithasastartingpointforthe
implementationoftheorderofseriesandadestination.Itisresponsibleforthemaintenanceofitsownstack,thestackforexceptionhandling,priorityschedulingandanumberofotherthreadingsystemsre-implementationoftheinformationneeded.Fromthisconcept,itseemsthereisnothreadwiththeprocessofdistinction,infact,threadandprocessiscertainlydifferent:
theprocessofacompleteindependencetohavetheirownmemoryspaceanddata,butthesamethreadwithinaprocessissharedmemoryspaceanddata.Correspondstoaprocessforsomeprocedures,itisbythesameprocedureinwhichanindependentthreadsrunningatthesametimethecomposition.Threadissometimesreferredtoasparallelprogramrunningonlightweightprocesses,threadsarelightweightprocessescalledbecauseitisdependentontheoperationandprocessthecontextoftheenvironment,andtheprocessofusingresources.Inaprocess,thethreadsarepreemptiveschedulingornon-preemptivemodel.Inseizingthemodel,theoperatingsystemresponsiblefortheallocationofCPUtimeforeachprocess,oncethecurrentprocessusedtofinishthedistributionofCPUtime,thenextoperatingsystemwilldeterminetheCPUtimeisoccupiedbyasinglethread.Thustheoperatingsystemwillperiodicallyinterruptthecurrentthreadisrunning,theallocationwillbecuptothenextinthequeuewaitingforathread.
Therefore,athreadcannotbeanyexclusiveCPU.OccupiedbyeachthreadCPUtime
dependsontheprocessandtheoperatingsystem.Processassignedtoeachthreadashortperiodoftimethatwefeelallthethreadsareexecutedatthesametime.Infact,thesystemtimeforeachprocess,2ms,andthenschedulingotherthreads.Itthesametime,hemaintainedallthethreadsandcirculation,thedistributionofsmallamountofCPUtimeto
thethread.Threadswitchingandschedulingissofastthatthefeelingisthatallthethreads
areexecutedsimultaneously.
Whatdoesschedulingmean?
SchedulingprocessorstoragemeanstobeimplementedbytheendoftheprocessofCPUtimeforthestateandafuturetimeloadingthestateofthe
processtoresumeitsoperation.Inthisway,howevertherearedeficiencies,onethreadatanygiventimeinterruptionoftheimplementationofathread.Supposeathreadisadocument
doeswriteoperation,andanotherthreadinterruptsitsoperation,alsothesamedocumentsdo
writeoperation.Windows95/NT,UNIXisusedinsuchawaythreadscheduling.
Innon-preemptiveschedulingmodel,eachthreadmayneedtooccupymuchtimeCPUtimeCPU.Schedulinginthisway,itmaybeaverylongexecutiontimemakesalltheother
threadsneedtothreadCPU"starvingtodeath."Intheprocessorisidle,thatis,whenthe
processdoesnotuseCPU,thesystemcanallowtheprocessoftemporarilyusingotherCPU.
CPUoccupationCPUthreadhasthepowertocontrolthereleaseofonlyitsowninitiative,CPU;otherthreadscanusetheCPU.SomeI/OandWindows3.xistheuseofthis
schedulingstrategy.
Insomeoperatingsystemsinside,whichwillusetwoschedulingstrategy.Non-preemptiveschedulingstrategyofrunninginthethreadprioritywhenusedingeneral,
andforhigh-priorityschedulingofthreadsistheuseofpreemptiveschedulingstrategy.If
youareunsureaboutthekindofsystemisthatschedulingstrategy,assumingthatthe
schedulingstrategycannotbeseizedisrelativelysafetouse.
Applicationinthedesign,webelievethatthosewhooccupyarelativelylargenumberofCPUtimeforacertainintervalthreadwillreleasethecontroloftheCPU,thistimethe
systemwillcheckthequeueofthosewaitinginsidethethreadcurrentlyrunningwiththe
sameprioritylevelorhigherprioritythreads,andthreadtousetheseCPU.Ifyoufindsuchasystemofthread,immediatelysuspendthecurrentlyexecutingthreadandactivatethethread
satisfycertainconditions.Ifyoudonotfindthesameorhigher-prioritythread,thecurrent
threadhasalsocontinuedtooccupyCPU.
WhenthethreadisrunningCPUwouldliketoreleasecontroltoalowprioritythread,thecurrentthreadintosleepstatetoallowlow-prioritythreadsholdtheCPU.
Inamulti-processorsystem,theoperatingsystemwilltheseindependentthreads
allocatedtothedifferentprocessorimplementation,thiswillgreatlyspeeduptheprocessofrunning.Theimplementationoftheefficiencyofthethreadwillbegreatlyimproved,
becausethethreadsoftime-sharingasingleprocessorintoadistributedmulti-processorimplementation.Thismulti-processorinthethree-dimensionalmodelingandgraphics
processingisveryuseful.
Doyouneedtomulti-threaded?
Wesentaprintorderrequestingtheprintertoprinttasks,assumingthatthistimeinresponsetothecomputerandtheprinterstoppedworkingalso,woulditmeanthatwedothingstostopwaitingforthisslowontheprinter?
Fortunately,thissituationdoesnotoccur,weworkintheprintercanalsolistentomusicordrawing.
Becauseweuseaseparatethreadstoperformthesetasks.Mayyouhavemultipleusers'
simultaneousaccesstoadatabaseorwebserverwassurprisedathowtheywork?
Thisis
becauseforeachconnectedtoadatabaseorwebserverusersetupanindependentthreadtomaintainthestatusoftheuser.
Ifaprogramisrunningacertaindegreeoforder,thistimeinthiswayproblemmayarise,andevenleadtothecollapseoftheentireprocess.Iftheprogramcanbedividedintodifferentindependenttasks,theuseofmulti-threaded,evenifacertainpartofthetaskfailed,ontheotherwouldnotbeaffected,willnotleadtothecollapseoftheentireprocess.Thereisnodoubtthattheproceduresforthepreparationofmulti-threadedtoolmakesyouaslavetodrivetheprocessofnon-multi-threaded,multi-threadedbutmayalsobecomeaburdenor
costneednotbesmall.Iftheimproperuseofitwillbringmoreofthedisadvantages.
Ifaprogramhasalotofthreads,thenthethreadisboundtootherprogramscanonlytakeuplessCPUtime;andalotofCPUtimeisusedforthreadscheduling;operatingsystemalsorequiressufficientmemoryspacetomaintaineachthreadcontextinformation;therefore,alargenumberofthreadswillreducetheefficiencyofsystemoperation.Therefore,iftheuseofmulti-threaded,thenthemulti-threadedprogrammustbedesignedwell,otherwisethe
benefitswillbefarlessthanthedisadvantages.Theuseofmultithreadedsowemustbecarefultodealwiththesethreadsofthecreation,schedulingandworkrelease.
Therearemanywaystodesignmulti-threadedapplications.Asshowninthebackofthearticle,Iwillgivedetailedexamplesofprogramming,throughtheseexamples;youwillbeabletobetterunderstandthemultithreaded.Threadscanhavedifferentpriorities,for
examples,inourapplicationsthere,ordoalotofgraphicsrenderingoperationsatthesametimetoacceptuserinput,itiscleartheuser'sinputneedstobethefirsttimetorespondto,andRenderingoryouneedalotofcomputingtime,thesuspensionisnottheproblem,souserswillneedtoenterthethreadofhigh-classleisure,and
graphicsrendering,orlowpriorityoperationcanbe.Independentofeachotherbetweenthesethreads.
Intheaboveexample,graphicsrendering,oralotofcomputingisclearlyneedtostop
usingalotofCPUtime,duringthisperiodoftime,theuserwaitingforthemthereisnoneedtore-inputinformationiscompleted,wewillprocessdesignedtoseparatethetwothreads,onefortheuser'sinput,thoseresponsiblefordealingwithaverylongtime-consumingtask.Thiswillmaketheproceduremoreflexibleandcanquicklyrespond.Atthesametime,userscanalsorunanytimethepossibilityoftheabolitionofthetask.Drawinggraphicsinthiscase,theprocedureshouldalwaysbemadetothesystemresponsibleforreceivingthenews.Iftheproceduresarebusyonamission,theremayresultintoablankscreen,whichisobviouslytheneedforourprocedurestodealwithsuchincidents.SoIhavetohaveathreadtodealwiththesesourcesisresponsiblefor,asIsaidearliershouldbethetriggeroftheworkofre-drawingthescreen.
Weshouldgrasptheprincipleoftime-forthosewhoneedtocomparetheurgencyofthe
taskimmediately,weareduetothehighprioritygiventheotherprioritiesofthethreadsshouldbelowerthanherpriority.Clientrequestslistenerthreadshouldalwaysbehighpriority,forauserinteractionwiththetaskoftheuserinterface;itneedstobethefirsttimeresponses,anditsprioritybecauseofthehigh-priority.
附录二
多线程相对于操作系统而言,指的是可以同时执行同一个程序的不同部分的能力,每个执行的部分被成为线程。
所以在编写应用程序时,我们必须得很好的设计以
避免不同的线程执行时的相互干扰。
这样有助于我们设计健壮的程序,使得我们可
以在随时需要的时候添加线程。
线程可以被描述为一个微进程,它拥有起点,执行的顺序系列和一个终点。
它负责维
护自己的堆栈,这些堆栈用于异常处理,优先级调度和其他一些系统重新恢复线程执行
时需要的信息。
从这个概念看来,好像线程与进程没有任何的区别,实际上线程与进程
是肯定有区别的:
一个完整的进程拥有自己独立的内存空间和数据,但是同一个进程内的线程是共享内存空间和数据的。
一个进程对应着一段程序,它是由一些
在同一个程序里面独立的同时的运行的线程组成的。
线程有时也被称为并行运行在程序里的轻量级进
程,线程被称为是轻量级进程是因为它的运行依赖与进程提供的上下文环境,并
且使用的是进程的资源。
在一个进程里,线程的调度有抢占式或者非抢占的模式。
在抢占模式
下,操作系统负责分配cpu时间给各个进程,一旦当前的进程使用完分配给自己的cpu时间,操作系统将决定下一个占用cpu时间的是哪一个线程。
因此操作系统将定期的中
断当前正在执行的线程,将cpu分配给在等待队列的下一个线程。
所以任何一个线程都不能独占cpu。
每个线程占用cpu的时间取决于进程和操作系
统。
进程分配给每个线程的时间很短,以至于我们
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 计算机专业 毕业论文 文献 翻译 资料