google云计算系列课程第一讲:介绍PPT课件.ppt_第1页
google云计算系列课程第一讲:介绍PPT课件.ppt_第2页
google云计算系列课程第一讲:介绍PPT课件.ppt_第3页
google云计算系列课程第一讲:介绍PPT课件.ppt_第4页
google云计算系列课程第一讲:介绍PPT课件.ppt_第5页
已阅读5页,还剩32页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

DistributedComputingSeminar Lecture1 IntroductiontoDistributedComputing SystemsBackground ChristopheBisciglia AaronKimball SierraMichels SlettvetSummer2007 Exceptwhereotherwisenoted thecontentsofthispresentationare Copyright2007UniversityofWashingtonandarelicensedundertheCreativeCommonsAttribution2 5License 1 CourseOverview 5lectures1Introduction2TechnicalSide MapReduce GFS2Theoretical AlgorithmsfordistributedcomputingReadings QuestionsnightlyReadings 2 Outline IntroductiontoDistributedComputingParallelvs DistributedComputingHistoryofDistributedComputingParallelizationandSynchronizationNetworkingBasics 3 ComputerSpeedup Moore sLaw Thedensityoftransistorsonachipdoublesevery18months forthesamecost 1965 Image Tom sHardwareandnotsubjecttotheCreativeCommonslicenseapplicabletotherestofthiswork Image Tom sHardware 4 Scopeofproblems Whatcanyoudowith1computer Whatcanyoudowith100computers Whatcanyoudowithanentiredatacenter 5 Distributedproblems Renderingmultipleframesofhigh qualityanimation Image DreamWorksAnimationandnotsubjecttotheCreativeCommonslicenseapplicabletotherestofthiswork 6 Distributedproblems Simulatingseveralhundredorthousandcharacters HappyFeet KingdomFeatureProductions LordoftheRings NewLineCinema neitherimageissubjecttotheCreativeCommonslicenseapplicabletotherestofthework 7 Distributedproblems Indexingtheweb Google SimulatinganInternet sizednetworkfornetworkingexperiments PlanetLab Speedingupcontentdelivery Akamai Whatisthekeyattributethatalltheseexampleshaveincommon 8 Parallelvs Distributed Parallelcomputingcanmean VectorprocessingofdataMultipleCPUsinasinglecomputerDistributedcomputingismultipleCPUsacrossmanycomputersoverthenetwork 9 ABriefHistory 1975 85 ParallelcomputingwasfavoredintheearlyyearsPrimarilyvector basedatfirstGraduallymorethread basedparallelismwasintroduced Image ComputerPicturesDatabaseandCrayResearchCorpandisnotsubjecttotheCreativeCommonslicenseapplicabletotherestofthiswork 10 Massivelyparallelarchitectures startrisinginprominenceMessagePassingInterface MPI andotherlibrariesdevelopedBandwidthwasabigproblem ABriefHistory 1985 95 11 ABriefHistory 1995 Today Cluster gridarchitectureincreasinglydominantSpecialnodemachineseschewedinfavorofCOTStechnologiesWeb wideclustersoftwareCompanieslikeGoogletakethistotheextreme 12 Parallelization Synchronization 13 ParallelizationIdea Parallelizationis easy ifprocessingcanbecleanlysplitintonunits 14 ParallelizationIdea 2 Inaparallelcomputation wewouldliketohaveasmanythreadsaswehaveprocessors e g afour processorcomputerwouldbeabletorunfourthreadsatthesametime 15 ParallelizationIdea 3 16 ParallelizationIdea 4 17 ParallelizationPitfalls Butthismodelistoosimple Howdoweassignworkunitstoworkerthreads Whatifwehavemoreworkunitsthanthreads Howdoweaggregatetheresultsattheend Howdoweknowalltheworkershavefinished Whatiftheworkcannotbedividedintocompletelyseparatetasks Whatisthecommonthemeofalloftheseproblems 18 ParallelizationPitfalls 2 Eachoftheseproblemsrepresentsapointatwhichmultiplethreadsmustcommunicatewithoneanother oraccessasharedresource Goldenrule Anymemorythatcanbeusedbymultiplethreadsmusthaveanassociatedsynchronizationsystem 19 WhatisWrongWithThis Thread1 voidfoo x y x Thread2 voidbar y x 3 Iftheinitialstateisy 0 x 6 whathappensafterthesethreadsfinishrunning 20 Multithreaded Unpredictability Whenwerunamultithreadedprogram wedon tknowwhatorderthreadsrunin nordoweknowwhentheywillinterruptoneanother Thread1 voidfoo eax mem x inceax mem x eax ebx mem x mem y ebx Thread2 voidbar eax mem y inceax mem y eax eax mem x addeax 3 mem x eax Manythingsthatlooklike onestep operationsactuallytakeseveralstepsunderthehood 21 Multithreaded Unpredictability Thisappliestomorethanjustintegers PullingworkunitsfromaqueueReportingworkbacktomasterunitTellinganotherthreadthatitcanbeginthe nextphase ofprocessing Allrequiresynchronization 22 SynchronizationPrimitives Asynchronizationprimitiveisaspecialsharedvariablethatguaranteesthatitcanonlybeaccessedatomically Hardwaresupportguaranteesthatoperationsonsynchronizationprimitivesonlyevertakeonestep 23 Semaphores AsemaphoreisaflagthatcanberaisedorloweredinonestepSemaphoreswereflagsthatrailroadengineerswouldusewhenenteringasharedtrack Onlyonesideofthesemaphorecaneverbered Canbothbegreen 24 Semaphores set andreset canbethoughtofaslock andunlock Callstolock whenthesemaphoreisalreadylockedcausethethreadtoblock Pitfalls Must bind semaphorestoparticularobjects mustremembertounlockcorrectly 25 The corrected example Thread1 voidfoo sem lock x y x sem unlock Thread2 voidbar sem lock y x 3 sem unlock Globalvar Semaphoresem newSemaphore guardsaccesstox y 26 ConditionVariables AconditionvariablenotifiesthreadsthataparticularconditionhasbeenmetInformanotherthreadthataqueuenowcontainselementstopullfrom orthatit sempty requestmoreelements Pitfall Whatifnobody slistening 27 Thefinalexample Thread1 voidfoo sem lock x y x fooDone true sem unlock fooFinishedCV notify Thread2 voidbar sem lock if fooDone fooFinishedCV wait sem y x 3 sem unlock Globalvars Semaphoresem newSemaphore ConditionVarfooFinishedCV newConditionVar booleanfooDone false 28 TooMuchSynchronization Deadlock SynchronizationbecomesevenmorecomplicatedwhenmultiplelockscanbeusedCancauseentiresystemto getstuck ThreadA semaphore1 lock semaphore2 lock usedataguardedbysemaphores semaphore1 unlock semaphore2 unlock ThreadB semaphore2 lock semaphore1 lock usedataguardedbysemaphores semaphore1 unlock semaphore2 unlock Image RPICSCI 4210OperatingSystemsnotes 29 TheMoral BeCareful SynchronizationishardNeedtoconsiderallpossiblesharedstateMustkeeplocksorganizedandusethemconsistentlyandcorrectlyKnowingtherearebugsmaybetricky fixingthemcanbeevenworse Keepingsharedstatetoaminimumreducestotalsystemcomplexity 30 FundamentalsofNetworking 31 Sockets TheInternet tubes AsocketisthebasicnetworkinterfaceProvidesatwo way pipe abstractionbetweentwoapplicationsClientcreatesasocket andconnectstotheserver whoreceivesasocketrepresentingtheotherside 32 Ports WithinanIPaddress aportisasub addressidentifyingalisteningprogramAllowsmultipleclientstoconnecttoaserveratonce 33 Whatmakesthiswork UnderneaththesocketlayerareseveralmoreprotocolsMostimportantareTCPandIP whichareusedhand in handsooften they reoftenspokenofasoneprotocol TCP IP Evenmorelow

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论