[omniORB] RE: object references management
Randy Shoup
randy.shoup@tumbleweed.com
Tue, 21 Mar 2000 10:36:52 -0800
Jorge Garc=EDa Velasco wrote:
>=20
> Hi David,
>=20
> Thanks for your answer, your solution runs correctly.
>=20
> Actually I'm programming a concurrent server that should create a lot=
of servants over client demand.
>=20
> 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.
>=20
> With this method the server avoids to have a servant reference list, =
a mutual exclusion to access to this list, a "garbage collector" to remov=
e the orphan references ( ex. if the client has crashed ), etc...
>=20
> About this, I have the next questions:
>=20
> - Is possible to detect when a client crashes from the server ?
No.
> , the reverse situation works fine.
>=20
> - Do you know some method that allows to deactivate the orphan servant=
s if the client has crashed and the server has not a servant list ?.
No.
>=20
> - Is there any function to know the number of references of a servant =
?.
If you mean "references by a client", no.
>=20
> - Do you recommend other solution to this system ?.
The common solution is to use a pattern called "evictor". There is an
explanation of this pattern on Iona's site, actually
(http://www.iona.com/Developers/Cookbook/evictor/evictor.html). It is
also explained in a more detailed way, I am told, in Advanced CORBA
Programming in C++, by Henning and Vinoski.
Another commonly-adopted solution is to use some sort of "pinging" or
"heartbeat" from client to server: when the client dies, the server no
longer receives the ping/heartbeat, and cleans up references for that
client. This solution does not scale well at all, and has many other
nasty properties, so it is not recommended.
Simply monitoring connection closures by clients is not sufficient,
since it is perfectly acceptable for a client to close a connection.=20
omniORB does this by default after a certain timeout period.
I recommend that you search the archives of the omniorb-list to find
references to, and discussions of, the evictor pattern, distributed
garbage collection, "deleting client references" etc. Also, about once
every 3 weeks or so, this issue is raised on the comp.object.corba
newsgroup. You can also search there for several sets of long
discussions on this topic.
Good luck.
-- Randy
_________________________________________________________________ =20
Randy Shoup (650)216-2038 =20
Senior Architect rshoup@tumbleweed.com =20
Tumbleweed Communications Corporation