Re: Object Reference counting idea.



Miguel de Icaza <miguel helixcode com> writes:

> [Elliot, can you read the last paragraph?]
> 
> Dum de dum.
> 
>    So, Michael and I have been discussing for some time a feature that
> we want to add to the base BonoboObject (dont worry, there are no API
> changes for this, it is entirely an optimizaton).  We would like the
> default ::ref and ::unref method implementations to keep track of
> reference counts in a per-client fashion instead of having an
> object-global reference count.
> 
>    This approach would solve a number of problems:
> 
> 	1. Clients with ref leaks: causing objects to never be destroyed.
> 
> 	2. Client with too many unrefs: causing other clients to run
>            into failure modes if an object is unrefed too many times.
> 
>    I recently found out that in COM, the runtime would actualy keep
> track of the references done for each client.  Upon death of the
> client all the references for that object would be released for
> example.  
> 
>    It is easy to do the code on the BonoboObject side, the only tricky
> part is "detecting" the clients given a CORBA_Object (I have done no
> research at all on this subject, and I am not sure if it is possible).

>From the point of view of the CORBA standard it is completely
impossible to do, since clients don't have to maintain an open
connection to the server.

ORBit does, currently, but the standard doesn't guarantee that,
and a lot of other implementations actually will close connections
eventually to save file descriptors.

To actually implement this, you'd have do something like create a mini
ping server in each client, pass an object reference to that server
and a unique ID with each ref() call, and the unique ID in each
unref() call.

[ the point of the unique ID is that you cannot compare object
  references for equality. ]

Regards,
                                        Owen




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