Thread: Re: [ Christopher Smith ] [Embedlets-dev] RE: [muvium] Embedlet Container
Status: Alpha
Brought to you by:
tkosan
|
From: Gregg G. W. <gr...@sk...> - 2003-06-24 03:20:56
|
>In designs where the wiring is fixed >there is no issue since it is inexpensive to create a listener array of >known size. Dynamic add/remove becomes more challenging. An array of null references is empty. Any loop through the array to deliver events can check for null listener references and skip those. On insert, you just find a null spot, doubling the size of the array if there are none. Delete just sets the entry to null. The expansion of the array is a convienence that will happen seldom enough in production code that it is a great savings is weird behavior/crashes due to there not being any slots. If you allocate a counter somewhere to count 'listener list overflows', you can inspect when this happens. You can also create a bit mask wide enough to hold an entry for each listener list to know which overflowed. This gets a little tedious in administration, but the runtime overhead is minmized for most small size listener lists. ----- gr...@cy... (Cyte Technologies Inc) |
|
From: James C. <ca...@vi...> - 2003-06-24 03:45:47
|
>An array of null references is empty. Any loop through the array to deliver >events can check for null listener references and skip those. On insert, you >just find a null spot, This is exactly how it is implemented in the muvium APT listeners.. (except its' done in assembler) except I am not doubling the size at the moment rather depending on the fixed sizing ( user defineable ). Down the trek it will be easy enough to do the slot size doubling. The thing about the listener model is that it is well understood and efficient which is why I prefer it for the container. What needs to be considered is how to publish events that interact with each other. It might be as simple a declaring Listener Interfaces.. James Caska www.muvium.com uVM - 'Java Bred for Embedded' -----Original Message----- From: Gregg G. Wonderly [mailto:gre...@po...] Sent: Tuesday, 24 June 2003 5:20 AM To: emb...@li... Cc: mu...@ya... Subject: Re: [ Christopher Smith ] [Embedlets-dev] RE: [muvium] Embedlet Container >In designs where the wiring is fixed >there is no issue since it is inexpensive to create a listener array of >known size. Dynamic add/remove becomes more challenging. An array of null references is empty. Any loop through the array to deliver events can check for null listener references and skip those. On insert, you just find a null spot, doubling the size of the array if there are none. Delete just sets the entry to null. The expansion of the array is a convienence that will happen seldom enough in production code that it is a great savings is weird behavior/crashes due to there not being any slots. If you allocate a counter somewhere to count 'listener list overflows', you can inspect when this happens. You can also create a bit mask wide enough to hold an entry for each listener list to know which overflowed. This gets a little tedious in administration, but the runtime overhead is minmized for most small size listener lists. ----- gr...@cy... (Cyte Technologies Inc) ------------------------ Yahoo! Groups Sponsor ---------------------~--> Looking for the latest Free IT White Papers? Visit SearchNetworking.com to access over 500 white papers. Get instant access at SearchNetworking.com Today http://us.click.yahoo.com/8lAzoD/OLNGAA/witMAA/5cFolB/TM ---------------------------------------------------------------------~-> To unsubscribe from this group, send an email to: muv...@ya... Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ |