欢迎来到天天文库
浏览记录
ID:34310211
大小:413.43 KB
页数:7页
时间:2019-03-04
《Mechanical Sympathy_ False Sharing.pdf》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、13-6-14MechanicalSympathy:FalseSharing分享19更多下一個網誌»建立網誌登入MechanicalSympathyHardwareandsoftwareworkingtogetherinharmonySaturday,30July2011SearchThisBlogFalseSharingSearchMemoryisstoredwithinthecachesysteminunitsknowascachelines.Cachelinesareapowerof2ofcontiguousUpcomingEventsbyteswhicharetypically32-2
2、56insize.Themostcommoncachelinesizeis64bytes.FalsesharingisatermwhichapplieswhenthreadsunwittinglyimpacttheperformanceofeachotherwhilemodifyingindependentvariablessharingthePerformanceTestingJavasamecacheline.WritecontentiononcachelinesisthesinglemostlimitingfactoronachievingscalabilityforparallelAp
3、plications-SkillsMatterLondonthreadsofexecutioninanSMPsystem.I’veheardfalsesharingdescribedasthesilentperformancekillerbecauseitisJavavs.C++PanelDebate-farfromobviouswhenlookingatcode.GOTOChicagoTop10PerformanceFolklore-Toachievelinearscalabilitywithnumberofthreads,wemustensurenotwothreadswritetothe
4、samevariableorcacheGOTOChicagoline.Twothreadswritingtothesamevariablecanbetrackeddownatacodelevel.Tobeabletoknowifindependentvariablessharethesamecachelineweneedtoknowthememorylayout,orwecangetatooltotellus.IntelVTuneissuchaprofilingtool.InthisarticleI’llexplainhowmemoryislaidoutforJavaobjectsandhow
5、wecanpadoutourAboutMecachelinestoavoidfalsesharing.MartinThompsonTechnologygeekexploringthecapabilitiesofmodernhardware.Availablefordevelopment,training,performancetuning,andconsultingservices.ViewmycompleteprofilePopularPostsCPUCacheFlushingFallacyEvenfromhighlyexperiencedtechnologistsIoftenheartal
6、kabouthowcertainoperationscauseaCPUcacheto"flush".Thissee...MemoryAccessPatternsAreImportantInhigh-performancecomputingitisoftensaidthatthecostofacache-missisthelargestperformancepenaltyforanalgorithm.Formany...NativeC/C++LikePerformanceForJavaObjectSerialisationDoyoueverwishyoucouldturnaJavaobjecti
7、ntoastreamofbytesasfastasitcanbedoneinanativelanguagelikeC++?Ifyouuses...CompactOff-HeapStructures/TuplesInJavaInmylastpostIdetailedtheimplicationsoftheaccesspatternsyourcodetakestomainmemory.Sincethe
此文档下载收益归作者所有