已阅读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. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 保险产品经理岗位面试要点及技能要求
- 仓储主管助理职业发展规划
- 区块链工程师助理区块链项目立项报告
- 供应链安全协调员安全文化建设方案
- 健身教练职业资格认证培训课程
- 企业培训中的积极心理引导
- 企业内部培训课程设计与实施效果评估
- AI技术在医药企业招聘中的高级应用与挑战
- 2025年湖北中考物理试题及答案
- 健身教练工作计划与运动指导方案
- 财务管理实践与案例分析
- 学校校服验收管理制度
- 2025年农村集体土地租赁合同范本
- smt员考试试题及答案
- 乳腺癌诊治指南与规范(2025年版)解读课件
- 二次元谷子店创业计划
- 事理论国防安全
- 2024-2025学年新教材高中语文第三单元11.1过秦论课时作业含解析新人教版选择性必修中册
- 2025年四川省德阳市事业单位招聘笔试高频重点提升(共500题)附带答案详解
- 植保无人机飞行作业服务应急及突发事件处理方案
- 机器学习(完整版课件)
评论
0/150
提交评论