欢迎来到天天文库
浏览记录
ID:40354440
大小:426.39 KB
页数:53页
时间:2019-07-31
《26-parallelism》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、CarnegieMellonThread-LevelParallelism15-213/18-213:IntroductiontoComputerSystems26thLecture,April21,2015Instructors:SethCopenGoldstein,FranzFranchetti,RalfBrown,andBrianRailing1CarnegieMellonTodayParallelComputingHardwareMulticoreMultipleseparateprocessorsonsinglechipHowtheymaintainconsistentvi
2、ewofmemoryHyperthreadingEfficientexecutionofmultiplethreadsonsinglecoreThread-LevelParallelismSplittingprogramintoindependenttasksExample:ParallelsummationSomeperformanceartifactsDivide-andconquerparallelismExample:Parallelquicksort2CarnegieMellonMulticoreProcessorCore0Coren-1RegsRegsL1L1L1
3、L1d-cachei-cache…d-cachei-cacheL2unifiedcacheL2unifiedcacheL3unifiedcache(sharedbyallcores)MainmemoryIntelNehalemProcessorE.g.,Sharkmachines(8cores/machine)Multipleprocessorsoperatingwithcoherentviewofmemory3CarnegieMellonMemoryConsistencyinta=1;intb=100;Thread1:Thread2:Wa:a=2;Wb:b=200;Rb:print(
4、b);Ra:print(a);Whatarethepossiblevaluesprinted?DependsonmemoryconsistencymodelAbstractmodelofhowhardwarehandlesconcurrentaccesses4CarnegieMellonNon-CoherentCacheScenariointa=1;Write-backcaches,withoutintb=100;coordinationbetweenthemThread1:Thread2:Wa:a=2;Wb:b=200;Rb:print(b);Ra:print(a);Thread1
5、CacheThread2Cachea:2b:100a:1b:200print1print100MainMemorya:1b:1005CarnegieMellonMemoryConsistencyinta=1;intb=100;ThreadconsistencyconstraintsWaRbThread1:Thread2:Wa:a=2;Wb:b=200;WbRaRb:print(b);Ra:print(a);Whatarethepossiblevaluesprinted?DependsonmemoryconsistencymodelAbstractmodelofhowhardwareha
6、ndlesconcurrentaccesses6CarnegieMellonMemoryConsistencyinta=1;intb=100;ThreadconsistencyconstraintsWaRbThread1:Thread2:Wa:a=2;Wb:b=200;WbRaRb:print(b);Ra:print(a);Whatarethepossiblevaluesprinted?DependsonmemoryconsistencymodelAbstractmodelofhowhardwarehandlesconcurrentaccessesSequentialconsiste
7、ncyOveralleffectconsistentwitheachindividualthreadOtherwise,arbitraryinterleaving7CarnegieMellonSequentialConsistencyExampleThreadconsistencyinta=1;constraintsintb=100;WaRbWbRaThread1:Thread2:Wa:a=2;Wb:b=
此文档下载收益归作者所有
点击更多查看相关文章~~