Re: Object Reference counting idea.



On Wed, 11 Oct 2000, Michael Meeks wrote:

>         Local   Remote
>         ref
>         ref
>                 ref
>                 ref
>                 unref
>                 unref 
>                 unref   <-- Erroneous unref. [3]
>         unref           <-- Servant destroyed
>         unref           <-- crash here.
> 
>         There are clearly multiple variations and degrees of pathology    
> here, there is no reason why we can't loop at [3] for ever ( having killed
> the Local object ) without issue. I am not however primarily concerned    
> with the stability of the ( broken ) script.

>         This is a far more intractible problem, what I want to solve is 
> scripts grabbing an interface reference and then unreffing it repeatedly
> until stuff gets badly screwed in the server ( which may be serving lots
> of clients like the panel ).

OK, I had never thought about this problem - I agree that leak handling
isn't something we want to address.

Me & George were talking about this on IRC, and he said that in grapevine
he solved this problem by giving out cookies to clients to let them
identify themselves. The main problem with this approach is that it means
that object references to the same object are no longer interchangeable...

It is actually possible to provide this type of solution without any
changes to the clients or interfaces. To do this, one would create a new
POA in the server, set its default servant, and then activate a new object
ID for every client that comes along and return the corresponding object
reference. When a client unrefs, use PortableServer_Current to find the
object ID and deactivate that object (and of course unref the servant and
destroy it if need be).

ORBit stable doesn't support the PortableServer_Current interface, which
would be a big obstacle to implementing this for now, but this does seem
like the right long-term solution.
-- Elliot
DEAR IRS, Please cancel my subscription.





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]