计算机专业毕业论文文献翻译资料.docx

上传人:b****1 文档编号:14160275 上传时间:2023-06-21 格式:DOCX 页数:10 大小:21.11KB
下载 相关 举报
计算机专业毕业论文文献翻译资料.docx_第1页
第1页 / 共10页
计算机专业毕业论文文献翻译资料.docx_第2页
第2页 / 共10页
计算机专业毕业论文文献翻译资料.docx_第3页
第3页 / 共10页
计算机专业毕业论文文献翻译资料.docx_第4页
第4页 / 共10页
计算机专业毕业论文文献翻译资料.docx_第5页
第5页 / 共10页
计算机专业毕业论文文献翻译资料.docx_第6页
第6页 / 共10页
计算机专业毕业论文文献翻译资料.docx_第7页
第7页 / 共10页
计算机专业毕业论文文献翻译资料.docx_第8页
第8页 / 共10页
计算机专业毕业论文文献翻译资料.docx_第9页
第9页 / 共10页
计算机专业毕业论文文献翻译资料.docx_第10页
第10页 / 共10页
亲,该文档总共10页,全部预览完了,如果喜欢就下载吧!
下载资源
资源描述

计算机专业毕业论文文献翻译资料.docx

《计算机专业毕业论文文献翻译资料.docx》由会员分享,可在线阅读,更多相关《计算机专业毕业论文文献翻译资料.docx(10页珍藏版)》请在冰点文库上搜索。

计算机专业毕业论文文献翻译资料.docx

计算机专业毕业论文文献翻译资料

计算机专业毕业论文文献翻译资料

附录一

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的时间取决于进程和操作系

统。

进程分配给每个线程的时间很短,以至于我们

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

当前位置:首页 > 经管营销 > 经济市场

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2