




已阅读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. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2026届山东省滕州市鲍沟中学九年级化学第一学期期中检测试题含解析
- 2026届广东省惠州光正实验化学九年级第一学期期中复习检测模拟试题含解析
- 2026届北京三中学九年级化学第一学期期中学业质量监测试题含解析
- 山东省济南市济阳县2026届化学九上期中学业质量监测试题含解析
- 建筑行业离职人员技术秘密保密协议与竞业限制
- 离婚协议公证及财产分割与子女抚养及监护权转移合同
- 离婚协议标准范本:财产分配及子女监护实施协议
- 智能化空调系统箱涵施工与物联网应用合同
- 离婚协议中债务承担及财产分割详细约定范本
- 金融机构职业健康安全与客户隐私保护合同
- 专利授权使用合同范本
- -思想政治教育学原理课件(精品课件)
- 教科版小学科学说课稿合集(附小学科学说课稿模板)
- 中国驻外领使馆地区分类
- 幼儿园教师读书笔记记录表
- 煤矿群监员培训
- 大学英语四级写作技巧及模板
- T-SZTIA 003-2020 抗菌口罩标准规范
- 颈动脉保护装选择
- 2023年东台市城市建设投资发展集团有限公司招聘笔试题库及答案解析
- 可测试性设计DFT课件
评论
0/150
提交评论