Technical Report no. 2002-02 NOBLE A Non-Blocking Inter-Process Communication Library 1
- 格式:pdf
- 大小:319.34 KB
- 文档页数:8
TechnicalReportno.2002-02
NOBLE:ANon-BlockingInter-ProcessCommunicationLibrary1
HåkanSundellPhilippasTsigas
DepartmentofComputingScience
ChalmersUniversityofTechnologyandGöteborgUniversity
SE-41296Göteborg,Sweden
Göteborg,2002
1PerformedwithinthenetworkforReal-TimeresearchandgraduateEducationinSweden(ARTES),supportedbytheSwedishFoun-dationforStrategicResearch(SSF)
TechnicalReportinComputingScienceat
ChalmersUniversityofTechnologyandGöteborgUniversity
TechnicalReportno.2002-02
ISSN:1650-3023
DepartmentofComputingScience
ChalmersUniversityofTechnologyandGöteborgUniversity
SE-41296Göteborg,Sweden
Göteborg,Sweden,2002Abstract
Manyapplicationsonsharedmemorymulti-processor
machinescanbenefitfromtheexploitationofparallelism
thatnon-blockingsynchronizationoffers.Inthispaper,we
introducealibrarysupportformulti-processnon-blocking
synchronizationcalledNOBLE.NOBLEprovidesaninter-
processcommunicationinterfacethatallowstheusertose-
lectsynchronizationmethodstransparentlytotheonethat
suitsbestforthecurrentapplication.Thelibraryprovidesa
collectionofthemostcommonlyuseddatatypesandproto-
colsinaform,whichallowsthemtobeusedbynon-experts.
Wedescribethefunctionalityandtheimplementationof
thelibraryfunctionsandillustratethelibraryprogramming
stylewithexampleprograms.Theexamplesshowthatus-
ingthelibrarycanconsiderablyreducetheruntimeondis-
tributedsharedmemorymachines.
1Introduction
Softwareimplementationsofsynchronizationconstructs
areusuallyincludedinsystemlibraries.Thedesignofa
goodsynchronizationlibrarycanbechallengingandmany
efficientimplementationsforthebasicsynchronizationcon-
structs(locks,barriersandsemaphores)havebeenproposed
intheliterature.Manysuchimplementationshavebeen
designedwiththeaimtolowerthecontentionwhenthe
systemisinahighcongestionsituation.Theseimple-
mentationsgivedifferentexecutiontimesunderdifferent
contentioninstances.Butstillthetimespentbythepro-
cessesonthesynchronizationcanformasubstantialpartof
theprogramexecutiontime[KarLMS91,MelS91,MicS98,
NikP99,ZahLE91].Thereasonforthisisthattypicalsyn-
chronizationisbasedonblockingthatunfortunatelyresults
inpoorperformance.Thisisbecauseblockingproduces
highlevelsofcontentiononthememoryandtheintercon-
nectionnetwork,andmoresignificantly,becauseitcauses
convoyeffects:ifoneprocessholdingalockispreempted,
otherprocessesondifferentprocessorswaitingforthelock
willnotbeabletoproceed.Researchershaveintroduced
non-blockingsynchronizationtoaddresstheaboveprob-
lems.
Therehasbeenmuchadvocacyarisingfromthethe-
orycommunityfortheuseofnon-blockingsynchroniza-
tionprimitivesratherthanblockingones,inthedesignof
inter-processcommunicationmechanismsforparalleland
highperformancecomputing.Thisadvocacyisintuitive
andmanyresearchershaveformorethantwodecadesde-
velopedefficientnon-blockingimplementationsforseveral
shareddataobjects.Despitethis,thescientificdiscover-
iesonnon-blockingsynchronizationhavenothavemigrated
muchintopractice,eventhoughsynchronizationisstillthebottleneckinmanyapplications.Thelackofastandardli-
braryofnon-blockingsynchronizationofshareddataob-
jectscommonlyusedinparallelapplicationshasplayeda
significantroleforthisslowmigration.
NOBLEoffersalibrarysupportformulti-processnon-
blockingsynchronizationforsharedmemorysystems.NO-
BLEhasbeendesignedinorder:I)toprovideacollection
ofshareddataobjectsinaformwhichallowsthemtobe
usedbynon-experts,II)toofferanorthogonalsupportfor
synchronizationwheretheapplicationcanchangesynchro-
nizationimplementationswithminimalchanges,III)tobe
easytoporttodifferentmulti-processorsystems,IV)tobe
adaptablefordifferentprogramminglanguagesandV)to
containefficientknownimplementationsofitsshareddata
objects.
Therestofthepaperisorganizedasfollows.Section2
outlinesthebasicfeaturesofNOBLEandtheimplementa-
tionanddesignstepsthathavebeentakentosupportthese
features.Section3illustratesbyawayofanexamplethe
useofthefeaturesofNOBLEinapracticalsetting.Section
4presentsrun-timeexperimentsusingNOBLEthatshow
theperformancebenefitsofnon-blockingsynchronization.
Finally,Section5concludesthispaper.
2DesignandFeaturesofNOBLE
WhendesigningNOBLEweidentifiedanumberofchar-
acteristicsthathadtobecoveredfromourdesigninorder
tomakeNOBLEeasytouseandusablebyawiderangeof
practitioners.WedesignedNOBLEtohavethefollowing
features:
Usability-Scope-NOBLEprovidesacollectionof
fundamentalshareddataobjectsthatarewidelyused
inparallelandreal-timeapplications.
Easytouse-NOBLEprovidesasimpleinterfacethat
allowstheusertousethenon-blockingimplementa-
tionsoftheshareddataobjectsthesamewaytheuser
wouldhaveusedlock-basedones.
EasytoAdapt-Noneedforchangesattheapplication
levelarerequiredbyNOBLEanddifferentimplemen-
tationsofthesameshareddataobjectsaresupported
viaauniforminterface.
Efficient-Userswillhavetoexperiencemajorim-