[omniORB] RE: object references management
Jorge García Velasco
jgarcia@mabyc.com
Tue, 21 Mar 2000 12:32:38 +-100
Hi David,
Thanks for your answer, your solution runs correctly.
Actually I'm programming a concurrent server that should create a lot of servants over client demand.
My intention is that the server returns the servant reference to the client who requests for, in order to delegate the servant release control to the client.
With this method the server avoids to have a servant reference list, a mutual exclusion to access to this list, a "garbage collector" to remove the orphan references ( ex. if the client has crashed ), etc...
About this, I have the next questions:
- Is possible to detect when a client crashes from the server ?, the reverse situation works fine.
- Do you know some method that allows to deactivate the orphan servants if the client has crashed and the server has not a servant list ?.
- Is there any function to know the number of references of a servant ?.
- Do you recommend other solution to this system ?.
Regards.
*****************************************************************************************************
On 20/03/2000 David Riddoch wrote:
Jorge,
You are releasing the object reference, but not deactivating the server object. At some point you need to do poa->deactivate_object() or something equivalent to cleanup the servant itself. An easy way to do this is to have a method in the object's interface -- however you could still get leaks if a client crashes.
You also need to do new_servant->_remove_ref() after activate_object() in da_objeto() to get your reference counting right.
Cheers,
David