[Opensim-dev] Proposal for a cleanup/correction of the region-module system

Homer Horwitz homerhorwitz at googlemail.com
Sun Jan 25 10:16:53 UTC 2009


On Sun, Jan 25, 2009 at 3:33 AM, Jeff Ames <jeffames at gmail.com> wrote:
>...
> For a non-shared module, is there a functional difference between
> Initialise and AddRegion?  Likewise with RemoveRegion and Close.
Registration happens in Initialise, so when the AddRegion call happens, all the
modules are available already.

Same for RemoveRegion and Close:
During RemoveRegion, all the modules are still available. During
Close, some might
have been closed before your module is closed.

On Sun, Jan 25, 2009 at 8:39 AM, Frisby, Adam <adam at deepthink.com.au> wrote:
>
>> For shared modules, is there some technical reason or use case that
>> requires a PostInitialise after Initialise?  The only case I can think
>> of is interdependent region modules that need each other to be
>> initialized before they can add regions.
>
> [Frisby, Adam]
>
> Close - it's more so you can start 'doing things' after every region has been registered. Prior to PostInitialise you cannot be sure that everything has been constructed yet, and/or other modules have registered their interfaces.

Actually, in the new one PostInitialise happens after every
*Initialise* has been run,
not after every *AddRegion* has been run. You just can't execute a method once
after all regions has been registered, as I can add regions on the fly
(that's one of
the problems I see with the old version as stated in the Wiki
article): You'll either
end up calling it more than once for some regions (if you call it
after every AddRegion),
or not at all for some regions (if you call it only once).

But for the intended new semantics: good point, Jedd, I added that
just because it is
in the current system. In PostInitialise, all the (shared) modules
have been registered
already. On the other hand, it's the same in AddRegion, and I'd find
it more consistent
to the non-shared modules to not depend on PostInitialise in the shared ones (in
AddRegion, the non-shared modules are available, too). If you have to
do something
that should happen after all the shared modules are initiali(z|s)ed,
it might make sense
to postpone it a bit further and do it when the first region is added.

So, +1 for making the interface a bit smaller and removing PostInitialise.

Cheers,
  Homer



More information about the Opensim-dev mailing list