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) |