[omniORB] Another attempt at "Reference Counting"?

Kevin Wooten kwooten@itracs.com
Thu, 21 Mar 2002 15:37:06 -0700


I dont believe this works. I have had this discussion before, and all =
suggestions were to work around it. Unfortunately since those =
discussions were a while ago I have forgotten the arguments against. =
Although, your scheme sounds correct, I believe the deactivation =
procedure throws a wrench into the process. Can anyone else elaborate or =
am I just wrong ( which would please me in this case! ).

Kevin

>> -----Original Message-----
>> From: Stefan Seefeld [mailto:seefeld@sympatico.ca]
>> Sent: Thursday, March 21, 2002 11:20 AM
>> To: Kevin Wooten
>> Subject: Re: [omniORB] Another attempt at "Reference Counting"?
>>=20
>>=20
>> Kevin Wooten wrote:
>>=20
>> > I know this has been debated already, but I really need=20
>> reference counting.=20
>>=20
>>  > I have, and have read, the bible, H&V; all the arguments=20
>> for Evictor
>>  > are compelling, and a good sell. Although, I need=20
>> reference counting,
>>  > I need deterministic desctruction of objects when they=20
>> lose all there=20
>>  > references. Is there any way to pund RC into an CORBA? I=20
>> am a big fan
>>  > of right tool for the right job and in this case RC is=20
>> the right tool.
>>  > Any help is appreciated.
>>=20
>> servant ref counting is already provided by the ORB, you=20
>> just need to=20
>> derive from the mixin class PortableServer::RefCountServantBase.
>> What you probably want here, is distributed ref counting,=20
>> i.e. you want
>> to add 'ref()' and 'unref()' methods to an (IDL) base interface.
>>=20
>> Assuming, then, that you hold a reference to a CORBA object that=20
>> provides these, methods. Assuming further that it's current=20
>> ref count is
>> at 1. If you call 'unref(), it gets down to 0, at which=20
>> point it should
>> deactivate itself. This means the POA will remove it from the active=20
>> object map, which removes a reference to the servant. The=20
>> servant, then,
>> being a PortableServer::RefCountServantBase, will delete itself...
>>=20
>> Hope this helps,
>> 		Stefan
>>=20
>>=20