[omniORB-dev] Removing an entry from proxyObjectFactory

Duncan Grisby duncan@grisby.org
Tue, 25 Feb 2003 15:20:26 +0000


On Thursday 20 February, Christian Perez wrote:

> The proxyObjectFactory global variables in the IDL generated files correctly
> register themself thanks to their constructor. However, there is
> no destructor. When such a code is unloaded from the memory,
> the list of registered proxyObjectFactory is incorrect because it contains
> dangling pointers.

There are fundamental difficulties with unloading stubs, which is why
it is not implemented. To unload stubs, it is essential that there are
no object references from those stubs instantiated. There is a race
condition, however, where a thread may be receiving an object
reference that unexpectedly claims to be of a type supported in the
stubs that are being unloaded. In that case, a new object reference
could be created just as the stubs are being unloaded.

If you can convince yourself that that situation will never arise in
your application, it would be safe to unload stubs, and unregister
their proxyObjectFactories.

[...]
> In attachement, you'll find such an implementation of proxyFactory.cc
> derived from omniORB3 (location src/lib/omniORB2/orbcore/proxyFactory.cc).
> This implementation is based on the used of the map of the C++ STL.

There are two problems here. First, your suggestion is not thread
safe. Second, it is not possible to use STL within omniORB, since it
is not available everywhere.

Cheers,

Duncan.

-- 
 -- Duncan Grisby         --
  -- duncan@grisby.org     --
   -- http://www.grisby.org --