[omniORB] Another attempt at "Reference Counting"?

bjorn rohde jensen shamus@tdcadsl.dk
Fri, 22 Mar 2002 01:21:33 +0100


Hi guys,

 I think, you need something a little more complicated than adding
a ref and unref method to the idl. You will need to address the
problem of fault tolerance.
 I think, a more robust approach would be do something like with tcp.
Use a single object factory on the real server, have the client act
as a corba server, but without an object factory. A client wishing
to contact the real server must then invoke a factory method taking
a callback object on the client and returning a new object for this
particular clients exclusive use.
 This would enable the real server to ask the client for permission
before evicting an object. It is important, that eviction does take
place, since a fault, while return from the invocation on the factory
being unmarshalled on the client could leave an dangling object on
the server.
 I think, this something like should work reasonably well, even if
clients network is not well behaved.

Yours sincerely,

bjorn

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