|
-
February 7th, 2010, 06:08 PM
#16
Re: static factory...
 Originally Posted by D_Drmmr
I don't see a big difference between the two options you describe. In one case you have a global repository in the other the repository is embedded in the class using it. So, IMO where you ask why, you should ask why not?
The overhead is the big difference for the event driven case (There's zero overhead for the global repository). You'll end up with Pnhandlers notifying DnHandlers of a PnMessage every 40ms. There's multiple PnHandlers and DnHandlers. The invocation rates of a handful of DnHandlers and the corresponding Pn Message event of interest is as follows:
D1Handler : 200ms intervals (P1 Message event )
D3Handler : 500ms intervals - don't care about Pn message events
D4Handler : 1200ms intervals (P2 message event )
D5Handler : 1300ms intervals (P3 message event )
The intervals simply reflect the rate at which the A/C sends the various messages. Simply put, given the execution flow in the pdf, when (1) executes at the intervals above I should Read a D1msg every 200ms, D3msg every 500ms etc.
From the pdf. What I could do is have the PnHandler (P1) notify the DnHandler (D1) with the P1 message event at Tn-40 (ms). In this case at T=160ms, T=320ms etc. IOW: 40 ms prior to the (1) pdf. Of course this becomes a nuisance given I'd have to do this for every Dn message
-
February 7th, 2010, 07:10 PM
#17
Re: static factory...
 Originally Posted by mop65715
The overhead is the big difference for the event driven case (There's zero overhead for the global repository).
I don't see how you can claim zero overhead. In any case, this sounds to me like a case of premature optimization.
If I were you, I would implement this in the simplest way possible first. Then start measuring performance and, if you find this to be a bottleneck, try to optimize it.
Cheers, D Drmmr
Please put [code][/code] tags around your code to preserve indentation and make it more readable.
As long as man ascribes to himself what is merely a posibility, he will not work for the attainment of it. - P. D. Ouspensky
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|