RealTime Event Channel Configuration.docx
- 文档编号:26456518
- 上传时间:2023-06-19
- 格式:DOCX
- 页数:14
- 大小:21.38KB
RealTime Event Channel Configuration.docx
《RealTime Event Channel Configuration.docx》由会员分享,可在线阅读,更多相关《RealTime Event Channel Configuration.docx(14页珍藏版)》请在冰豆网上搜索。
RealTimeEventChannelConfiguration
Real-TimeEventChannelConfiguration
ConfiguringtheEventChannelatCompilationTime
TAO'sReal-TimeEventChannelcanbeconfiguredatcompilationtimetouseadifferentpayloadthanitsdefault.Todosothereareseveraloptions:
∙Toeliminatethe CORBA:
:
Any fieldintheeventpayloadyoushoulddefinethe TAO_LACKS_EVENT_CHANNEL_ANY macrowheninvokingtheIDLcompiler.Youcandoasfollows:
∙$cd$TAO_ROOT/orbsvcs/orbsvcs
∙$makeTAO_IDLFLAGS=-DTAO_LACKS_EVENT_CHANNEL_ANY
∙Similarlyyoucaneliminatetheoctetsequencefieldintheeventpayloadusing:
∙$cd$TAO_ROOT/orbsvcs/orbsvcs
∙$makeTAO_IDLFLAGS=-DTAO_LACKS_EVENT_CHANNEL_OCTET_SEQUENCE
∙Finallyyoucanprovideyourowneventpayload,todothisyoushouldReplacethecontentsofthe RtecDefaultEventData.idl anddefinesomeIDLstructurenamed RtecEventData.Forexample,youcoulddefineyouowneventtypeasfollows:
∙//ReplaceRtecDefaultEventData.idlwiththis:
∙
∙structRtecEventData
∙{
∙sequence
∙};
Run-timeConfiguration
Thenewimplementationofthereal-timeeventchannelusesafactorytobuildalltheobjectsandstrategiesitrequires.ThefactorycanbedynamicallyloadedusingACEServiceConfigurator,thisisextremelyconvenientbecausethefactorycanalsoparseoptionsintheServiceConfiguratorscriptfile.
Therearecurrentlyseveralimplementationsofthefactory.
∙The default factorysupportsalloftheoptionsbelowandmostofthepotentialvalues,exceptasspecificallyindicated.
∙The sched factorydefinesnewoptionvaluesasindicatedbelowthatallowtheRTEStointegratewiththeReal-TimeSchedulingService.Useofthesched factoryrequiresthatyoulinkintheTAO_RTSchedEventlibrary.
∙The tpc (threadperconsumer)factorydefinesnewoptionsvaluesasindicatedbelow.ThisstrategyissimilartotheMTdispatchingstrategyinthatitseparatesthethreadthatreceivesthepush()fromasupplierfromthethreadthatdoestheeventualpush()totheconsumer(s),butitdiffersfromMTinthatMThasapoolofthreadspullingfromasinglequeueandultimatelypotentiallyservicingeveryconsumer,whereasTPChasaqueuefor eachconsumerand,thus,asinglethreaddedicatedtopushingtothatconsumer.Thisinsuresthatabadly-behavedconsumer CANNOT haveanadverseeffectonthechannelorsupplier.
Tousethisnewstrategyyouwillhavetoreplacethecallinyourcodefor TAO_EC_Default_Factory:
:
init_svcs() with TAO_EC_TPC_Factory:
:
init_svcs().
∙The basic and null factoriesarehard-codedfactoriesthatdonotsupportanyconfigurationoptions.TheybothdefinesimpleconfigurationsthatmayenablesomeapplicationstousetheRTESinasmallerfootprint.Seethefiles $TAO_ROOT/orbsvcs/orbsvcs/Event/EC_Null_Factory.h and$TAO_ROOT/orbsvcs/orbsvcs/Event/EC_Basic_Factory.h fordetails.
SpecialTopic:
QueueConfiguration
Incertainconfigurationssuchas mt and tpc,theRTESimplementationusessomethingcalled TAO_EC_Queue,whichisanin-memoryqueuethatseparatesthreadsthatreceive push() invocationsfromsuppliersfromthethreadsthatdispatch push() invocationstoconsumers.AuseroftheRTEScanconfiguresomebehaviorsofthisqueueaswellasbehaviorswhenthequeuereachescertaintriggerpoints.Theconfigurationofthesebehaviorsisacombinationofcompile-timeandrun-timespecification.
Thequeueitselfhastwotriggerpointsforthenumberofinvocationsinthequeue:
∙low-watermark(LWM),alowerthresholdbelowwhichthequeueallowsmoreinvocationstobeplacedintothequeue;
∙high-watermark(HWM),anupperthresholdabovewhichthequeuepreventsmoreinvocationsfrombeingaddedtothequeue
Thevaluesforthesecanbesetatcompiletimevia TAO_EC_QUEUE_LWM and TAO_EC_QUEUE_HWM forthelow-watermarkandhigh-watermark,respectively.
Inaddition,anapplicationcanspecifywhattheRTESshoulddoifaqueuereachestheHWM,i.e.,fillsup.Thisbehaviorisencapsulatedinaderivationofan ACE_Service_Object,called TAO_EC_Queue_Full_Service_Object.TheRTESlooksforaserviceobjectofaparticularname(thedefaultforthisnameisinmacroTAO_EC_DEFAULT_QUEUE_FULL_SERVICE_OBJECT_NAME,whichis"EC_QueueFullSimpleActions")andinvokes queue_full_action() ontheinstance.SeeclassTAO_EC_Simple_Queue_Full_Action infile $TAO_ROOT/orbsvcs/orbsvcs/Event/EC_Dispatching_Task.h foranexample.Thisparticularexamplecanbeconfiguredtoeither waitor discard newinvocationsonreachingtheHWM.
Theconfigurationfile
Thereal-timeeventchannelusesthesameserviceconfiguratorfilethattheORBuses,thedefaultnameforthisfileis svc.conf,buttheORBoption -ORBSvcConf canbeusedtooverridethis.Theformatofthefileisdescribedindetailintheserviceconfiguratordocumentation,buttherelevantsectionfortheeventchannellookslikethis:
#Commentsgohere...
#Morecommentsifyouwantto...
staticEC_Factory"-ECFilteringbasic....."
#...andoptionally...
staticEC_QueueFullSimpleActions"[wait|discard]"
#...oryoucandefineyourownTAO_EC_Queue_Full_Service_Object,
#giveitwhatevernameyouwantanduse-ECQueueFullServiceObject
#(seebelow)tospecifythatobject'sserviceconfiguratortag.
Thetablebelowdescribesalloftheoptions(andvalues)supportedbythesefactories.
Alltheeventservicefactoryoptionsstartwith -EC
Theoptions
Option
Description
-ECDispatchingdispatching_strategy
Selectthedispatchingstrategyusedbythereal-timeeventservice.The reactive strategyusesthesamethreadthatreceivedtheeventfromthesuppliertopushtheeventtoalltheconsumers.
The priority strategy(schedfactoryonly)usesaprioritizedpoolofthreadsandqueriestheschedulingservicetoselectthethreadthatdispatcheseachevent.
The mt strategyalsousesapoolofthreads,butthethreadtodispatchisrandomlyselected.
Doesnotapplytothe tpc factory.
-ECDispatchingThreadsnumber_of_threads
Selectthenumberofthreadsusedbythe mt dispatchingstrategy.
Doesnotapplytothe tpc factory.
-ECDispatchingThreadFlagsthread_flags:
thread_priority
Provideflagsandpriorityusedforcreationofdispatchingthreads.
thread_flags isasetof THR_ flagsseparatedbytheverticalbar('|'),e.g., THR_BOUND|THR_NEW_LWP|THR_SCOPE_SYSTEM.
thread_priority isanumericvalueindicatingthedesiredpriorityatwhichthethreadshouldbecreated.Norangecheckingisperformedonthevaluepriortopassingtothethreadcreationfunction.Alsonotethatprioritiesareplatform-specific,soavalidvalueforagivensetofflagsononeplatformmaynotworkwiththesameflagsonanotherplatform.
-ECQueueFullServiceObjectservice_object_name
Usedtospecifythename/tagintheserviceconfiguratorthroughwhichtheRTECshouldlookfora"queuefullserviceobject".
Willonlyhaveaneffectondispatchstrategiesthatuse TAO_EC_Queue.
-ECFilteringconsumer_filtering_strategy
Selectthefilteringstrategyusedbytheconsumers.The null filteringstrategywillbuildtrivialfiltersforallconsumers.The basic filteringstrategysupportsdisjunction,conjunction,logicaland,negation,bitmask,andtimeoutfiltersbasedonthesubscriptionspassedbytheconsumerduringtheconnectcall.Itonlysupportslimitednestingoffiltergroups.Theprefix filteringstrategysupportsallfiltertypesthatthe basic strategydoesandallowsunlimitednestingoffiltergroups.Whenusingthe prefix strategy,thesourcefieldofthegroupfiltermustspecifythenumberofchildreninthegroup.The priority filteringstrategy(schedfactoryonly)supportsthesamefeaturesasthe basic filteringstrategy,butitalsocollaborateswiththeschedulingservicetobuildthedependencygraph.
-ECSupplierFilteringsupplier_filtering_strategy
Theeventchannelcanalsoperformsomefilteringclosetothesuppliersbyminimizingthenumberofconsumersthataretestedforgivenevent.Ifthestrategyis null thenaglobalcollectionofconsumersismaintainedandeacheventisfilteredbyeachconsumer.Ifthestrategyis per-supplier thentheECusesthesupplierpublicationsandtheconsumersubscriptionstodeterminewhichconsumerscouldpotentiallybeinterestedineventsforeachsupplier.Thissetofconsumersisusuallysmallerthanthecompletesetanditisthusfastertotraverseit,butkeepingmorecollectionsofconsumersincreasestheconnectionanddisconnectiontimeaswellasthememoryrequirements.
-ECTimeout timeout_strategy
Aconsumercanrequestthattheeventchannelgenerateperiodicoroneshottimeoutevents.Thisoptioncontrolsthestrategytogeneratethetimeouts,using reactive thesamereactorusedfortheORBisusedbytheeventservice.The priority strategy(schedfactoryonly)usesaprioritizedgroupofthreads,timeoutswithhigherratearegeneratedbythreadsofhigherpriority.
NOTE:
The priority strategyisnotimplemented
-ECObserver observer
TheeventchannelusestheObserverpatterntoreportchangesinthesubscriptionsandpublicationsofitssuppliersandconsumers;thisisespeciallyusefulintheimplementationofeventchannelgateways.Theusercandisablethisfeaturebyselectingthe null strategy;whereasthe basic strategyprovidesasimple,yetefficientimplementation. reactive providesastrategyinwhichanobserverthatisunreachableisremovedfromtheobserverlist.
NOTE:
Thedefaultistohavethefeaturedisabled.
-ECSchedulingscheduling_strategy
Theeventchannelcancollaboratewiththeschedulingservicetobuildthedependencylistbetweentheconsumersandthesuppliers.Ifthe null schedulingstrategyisselectedthisfeatureisdisabled,the priority strategy(schedfactoryonly)enablesthisfeature.
NOTE:
Thedefaultistohavethefea
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- RealTime Event Channel Configuration