[omniORB] ref counting and object deactivation/destruction

Stefan Seefeld seefelds@MAGELLAN.UMontreal.CA
Thu, 31 Aug 2000 10:24:29 -0400


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