[omniORB] Re: [Berlin-design] ref counting and object deactivation/destruction

Andrew n marshall amarshal@zig.usc.edu
Thu, 31 Aug 2000 09:32:02 -0700 (PDT)


It sounds like you have a bigger problem.  If you are doing reference
counting and the nodes are refering to each other (and each has
incremented its reference count because of it), the references will
never go to zero except by forcably deleting the objects (i.e., the
poa-destroy(...) methods?).  Thus, your garbage collection doesn't work
very well.

And I don't think you can wait for references to go to 1 because most leaf
nodes are still important.

Did I miss something in your description?


On Thu, 31 Aug 2000, Stefan Seefeld wrote:

> I'm in the process of debugging a new memory management 
> strategy I use for the scene graph objects in the berlin
> project, and I come across some trouble.
> 
> The nodes reference each other, if they are connected.
> In the parent node's destructor, it decreases the ref counter
> for the child after having 'unlinked' itself from it, which
> ultimately triggers the child's destructor to be called, if
> it was the only holder of a reference.
> 
> Assuming both nodes are owned by the same POA and it's
> the POA's shutdown which deletes the nodes. All is fine
> if I use poa->destroy(true, true) since the deletion is
> serialized, i.e. only one object at a time will be deactivated
> but still alive (i.e. inside its destructor).
> 
> What if both nodes belong to different POAs ? The POAs
> could be destroyed at the same time from within different
> threads. I.e. both, the parent and the child node could
> be deactivated but still in their respective destructors.
> This is a race condition, as each attempt to inform the
> peer node of the deletion of 'this' node would fail.
> 
> This leads me to a general question:
> First, is there a way around this ?
> Second, what strategies do others use to protect the application
> from the various CORBA exceptions ? Should every (possibly) remote
> call be wrapped in a 'try' clause ?
> 
> Any suggestions are welcome,
> 
> Stefan
> _______________________________________________________              
>               
> Stefan Seefeld
> Departement de Physique
> Universite de Montreal
> email: seefelds@magellan.umontreal.ca
> 
> _______________________________________________________
> 
>       ...ich hab' noch einen Koffer in Berlin...
> _______________________________________________
> Berlin-design mailing list
> Berlin-design@lists.sourceforge.net
> http://lists.sourceforge.net/mailman/listinfo/berlin-design
>