文档下载 文档下载导航
设为首页 | 加入收藏
搜索 请输入内容:  
 导航当前位置: 文档下载 > 所有分类 > Lock-free scheduling of logical processes in parallel simulation
侵权投诉

Lock-free scheduling of logical processes in parallel simulation

With fixed lookahead information in a simulation model, the overhead of asynchronous conservative parallel simulation lies in the mechanism used for propagating time updates in order for logical processes to safely advance their local simulation clocks. St

throughr)hasbeenaddedtoCNTi.Further,eachreturnedtokenhasbeenaccompaniedbyanexecutionofline10thatdecrementsCNTibyone.Therefore,CNTi=(numberoftokensdeliveredbyLPi) (numberofreturnedtokens)duringtheintervalinquestion.Sinceeachreturnedtokenhasbeenpreviouslydelivered,CNTi≥0.Duringthein-tervalinquestion,CNTimayonlybechangedbyanexe-cutionofline10,andnotbyaboostevent,henceitsvalueisnon-increasing.

Lemma2LetrbearedroundofLPi.Atthebeginningofroundr+1,CNTi=0andalltokensdeliveredbyLPihavebeenreturned.

Proof:Ifrisared-goround,theprooffollowsfromLemma1,sinceared-goboostleavesCNTi=0.Nowsupposerisared-stopround.WeobservethatthevalueofCNTiisincreasedbyboostevents(line24).Red-stopboostleavesCNTi>0.Red-goboostleavesCNTi=0.ThevalueofCNTimaydecreaseorremainunchanged,butnotincrease,betweentwoboostevents.Recallthatanunblockeventisanexecutionofline10byapredecessorofLPithatresultsinCNTi=0.Thereforethereisatmostoneunblockeventbetweenared-stopboostandthenextboost.Also,thereisnounblockeventbetweenared-goboostandthenextboost.Thus,atanytime,(numberofred-stopboosts)≥(numberofunblockevents).

Atthebeginningofroundr+1,eachofthepastred-stoproundsofLPicanbepairedwithanunblocksignal(generatedbyanunblockevent)thatwasexpendedonitsbehalf(sincethereisanextroundthatfollowseachofthesered-stoprounds).Hence,(numberofred-stopboosts)≤(numberofunblockevents).Therefore,(numberofred-stopboosts)=(numberofunblockevents).Thismeansthatthereisanunblockeventthatfollowsthered-stopboostinroundr.ByLemma1,thisimpliesthatatthebeginningofroundr+1,CNTi=0,andalltokensdeliveredbyLPihavebeenreturned.

Theorem5.1LetLPibereadyandblocked,withti≤HT.ThenLPiiseventuallyunblocked.

Proof:LetthelastroundLPiexecutedbeforeLPibe-cameblockedberounds.(Roundsisthereforeared-stopround.)Letr(r<s)besuchthatroundrisred,roundsr+1,r+2,···,s 1aregreen.ByLemma2,atthebegin-ningofroundr+1,alltokensdeliveredbyLPiinrounds1,2,···,rhavebeenreturned.Therefore,afterthered-stopboostinrounds,CNTi=(numberofunreturnedtokensdeliveredinroundsr+1,r+2,···,s).Weobservethat:(1)Alltokensdeliveredinagreenround(hence,inroundsr+1,r+2,···,s 1)aredeliveredtonon-criticalparents.(2)Anytokendeliveredtoanon-criticalparenthasalreadybeenretrievedbytheparent(bythetimeLPiexecutesline

20),andwilleventuallybereturned.Theseobservationsimplythatifalltokensdeliveredtocriticalparentsinroundsareeventuallyreturned,theneventuallyCNTi=0.

Byassumption,LPiisready.Thus,eachcriticalparentLPkhasalreadyupdatedchanneltimeTk,itosomevalueτk,i(τk,i>ti).TheattemptbyLPktoretrieveatokenatchanneltimeτk,ihappensafterLPiissuesatokenforLPk(atline15)inrounds.Ifthetokenhasnotbeenpre-viouslyretrievedbyLPk,itcertainlywillberetrievedbytheattemptofLPkatchanneltimeτk,i.Thereforeallto-kensdeliveredtocriticalparentsinroundsareeventuallyreturned.ThismeansthateventuallyCNTi=0andthatthereisanunblockeventthatcausesLPitobeunblocked.Lemma3Thereissome >0suchthat,forallLPi,thevalueoftiincreasesbyatleast ineverynon-futileround.WeomittheproofastheLemmasimplyrestatestheboundednesspropertyprovenin[1].

Lemma4Foranytimeτ,thereisatmostoneroundofLPithatisfutileatτ.

Proof:LetroundrofLPibefutileatτ.Roundr 1mustbered.TheremustbeapredecessorofLPi,sayLPk,thatiscriticalwithchanneltimeTk,i=τinbothroundsr 1,r.Weclaimthatevent(E1)precedes(E2),whichinturnprecedes(E3),where:

E1:LPiexecutesline14inroundr 1,readingTk,i=τ.E2:LPkretrievesthetokendeliveredinroundr 1by

LPi.E3:LPiexecutesline2inroundr,readingTk,i=τ.(E1)precedes(E2)because(E1)precedesLPiissuingthetokenforLPkatline15ofroundr 1,whichinturnprecedes(E2).(E2)precedes(E3)because,byLemma2,thetokendeliveredforLPkinroundr 1hasbeenreturnedatthebeginningofroundr.

Letαbesuchthatevent(E2)isLPk’sretrievaloftokenatchanneltimeTk,i=α.Ifα<τ,thenat(E1),LPimustreadTk,i<τ(because(E1)precedes(E2)).Ifα>τ,thenat(E3),LPimustreadTk,i>τ(because(E3)follows(E2)).Therefore,α=τ.Wehaveshownthatifroundrisfutileatτ,thenthereisacriticalparentLPkthatretrievesatokendeliveredbyLPi(inroundr 1)atchanneltimeτ.Supposetherearemorethanonefutileroundsatτ.With-outlossofgenerality,letroundsr,r+1befutileatτ.Bythesameargument,thereisacriticalparentLPkwhore-trievesatchanneltimeTk,i=τboththetokendeliveredinroundr 1andthetokendeliveredinroundr.However,fromline3,thereisatmostonetokenretrievalbyLPkatchanneltimeτ.ThiscontradictionprovesthatthereisatmostoneroundofLPithatisfutileatτ.

上一页第7页

你可能喜欢

热门文档

相关文档

站点地图 | 文档上传 | 侵权投诉 | 手机版
本站所有资源均来自互联网,本站只负责收集和整理,均不承担任何法律责任,如有侵权等其它行为请联系我们.
文档下载 Copyright 2013 doc.guandang.net All Rights Reserved.  -  email