Nanothreads-vs.-Fibers-for-the-Support-of-Fine-Gra

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

Nanothreadsvs.FibersfortheSupportofFineGrainParallelismonWindowsNT/2000PlatformsVasileiosK.Barekas,PanagiotisE.Hadjidoukas,EleftheriosD.Polychronopoulos,andTheodoreS.PapatheodorouHighPerformanceInformationSystemsLaboratoryDepartmentofComputerEngineeringandInformatics,UniversityofPatrasRio26500,Patras,Grecce{bkb,peh,edp,tsp}@hpclab.ceid.upatras.gr:theuser-levelthreadpackages,theruntimelibrariesandtheapplicationslevel.TheresultsdemonstratethatnanothreadsoutperformtheWindowsfibers.Theperformancegainsofthethreadcreationandcontextswitchingmechanismsarereflectedonbothruntimelibraries.Experimentswithfine-grainapplicationsdemon-strateupto40%higherspeedupinthecaseofnanothreadscomparedtothatoffibers.1IntroductionDuringthelastfewyears,therehavebeensignificanttechnologicaladvancesintheareaofworkstationsandservers.Thesesystemsarebasedonlow-costmulti-processorconfigurationsrunningconventionaloperatingsystems,likeWindowsNT.Althoughtheperformanceofthesesystemsiscomparabletothatofothermoreexpensivesmall-scaleUnix-basedmultiprocessors,thesoftwareusedisin-adequatetoutilizetheexistinghardwareefficiently.Parallelprocessingonthesesystemsisinaprimitivestage,duetothelackofappropriatetoolsfortheeffi-cientimplementationofparallelapplications.Theparallelizationofasequentialapplicationrequirestheexplicituseandknowledgeoftheunderlyingthreadar-chitecture.Furthermore,theuserhimselfmustdetectthepotentialparallelism.Asweshowinthispaper,theexistingsupportprovidedbytheWindowsisinad-equatefortheefficientimplementationofawiderangeofparallelapplications.M.Valeroetal.(Eds.):ISHPC2000,LNCS1940,pp.146–159,2000.cSpringer-VerlagBerlinHeidelberg2000Nanothreadsvs.FibersfortheSupportofFineGrainParallelism147Ontheotherhand,mostofthehigh-endmultiprocessorsrunningUnix-likeoperatingsystemprovideadequateandconvenienttoolstotheuserinordertobuildparallelapplications,whichcanbeexecutedwiththelowestpossibleoverhead.Suchadvancedtoolsconsistofanautomaticparallelizingcompiler,anoptimizedmulti-threadingruntimelibraryandtheappropriateoperatingsystemsupport[1,3].Directivesareinsertedmanuallyorautomaticallyatcompiletimeintothesequentialcodetospecifytheexistingparallelism[11].ThemodifiedcodeisanalyzedandthedirectivesareinterpretedintoappropriateruntimeAPIfunctions.Thefinalcodeiscompiledandlinkedwiththeruntimelibrarytoproducetheparallelizedexecutable.Inthispaper,wepresenttheimplementationoftwomultithreadedruntimelibraries,bothbasedonuser-levelthreadsrunningonWindows2000.Theseli-brariesarespeciallydesignedtoprovidetheuserwiththenecessarysupportfortheefficientparallelizationofapplications.Thefirstlibrary,calledFibRT(FibersRunTime),usesthestandardWindowsfibers,whilethesecondone,calledNTLib(NanoThreadsLibraryforNT),usesnanothreads,acustomuser-levelthreadspackage.TheNTLibruntimelibrarywasportedtoWindows2000operatingsystemfromitsoriginalimplementationontheIRIXoperatingsystem[1].BothFibRTandNTLiblibrariesareimplementedaccordingtotheNanothreadsPro-grammingModel[12].TheselibrariesexportthesameAPItotheuser,providingthesamefunctionality.Fortherestofthispaper,thetermruntimelibrarywillrefertobothFibRTandNTLib,unlessotherwisespecified.Wecomparebothimplementationsintermsofruntimeoverhead,andtheperformancegainsbyusingthemintheparallelizationandexecutionofrealapplications.Therestofthispaperisorganizedasfollows;Section2providesthenecessarybackground.InSection3,wepresentthetworuntimelibrariesintroducedinthispaper,togetherwiththenecessarydetailsofourimplementations.PerformancestudyandexperimentalresultsarepresentedinSection4.InSection5,wepresentrelatedwork;finally,wesummarizeinSection6.2BackgroundInthissectionweoutlinethemultithreadingsupportprovidedintheWindows2000operatingsystem,forbothkernel-levelanduser-levelthreads,alongwiththeNanothreadsProgrammingModel.2.1WindowsMultithreadedArchitectureTheWindows2000operatingsystemsupportsmultiplekernel-levelthreads,throughapowerfulthreadmanagementAPI[14].Thesethreadsaretheop-eratingsystem’ssmallestkernel-levelobjectsofexecutionandprocessesmayconsistofoneormorethreads.Eachthreadcancreateotherthreadsthatsharethesameaddressspaceandsystemresourceshavinghowever,independentex-ecutionstackandthreadspecificdata.Kernel-levelthreadsarescheduledonasystemwidebasisbythekernelinordertobeexecutedonaprocessor.It148VasileiosK.Barekasetal.isthroughthreadsthatWindowsallowsprogrammerstoexploitthebenefitsofconcurrencyandparallelism.Sincethesethreadsarekernel-level,theirstateresidesintheoperatingsystemkernel,whichisresponsiblefortheirscheduling.Besidesk

1 / 14
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功