Re: Object Reference counting idea.
- From: Michael Meeks <michael helixcode com>
- To: Miguel de Icaza <miguel helixcode com>
- Cc: Maciej Stachowiak <mjs eazel com>, Elliot Lee <sopwith redhat com>, gnome-components-list gnome org
- Subject: Re: Object Reference counting idea.
- Date: Tue, 10 Oct 2000 11:06:44 -0400 (EDT)
Hi all,
Here is my proposal ( based on a discussion with George Lebl in
Toronto about what happens in the panel ); which is simple, almost
entirely foolproof, trivial to implement and yet gives us a fair whack of
protection.
We partition refs and unrefs into 2 sorts; local and
remote.
* Remote is defined as coming through impl_Bonobo_Unknown_ref.
* Local is defined as coming immediately though bonobo_object_ref.
NB. 'Remote' calls thus can happen in-process for shared
libraries, or even by doing Bonobo_Unknown_ref/unref in the server
process.
So; we have 2 reference counts; We flag errors and refuse to do
more Remote ref/unrefs than we have refs / unrefs. We have some policy for
the local case that could be:
* Warn on too many unrefs but do it anyway
* Warn and don't do it
* Don't warn and do it.
I don't much care about the latter policy, but I'd prefer Warn and
don't do it.
So; the advantage of this is that remote scripts have no chance of
crashing the system by unreasonable ref / unrefs ( unless they try and
wrap the ref-count :-).
I've been meaning to do this for some time. Of course, the obvious
advantage is simplicity, I'll hack up a patch sometime soon and see if it
impacts much existing code.
Of course; if we try to do anything more for Gnome 2.0, I'd like
to read up on distributed garbage collection, everyone keeps claiming this
is an unsolved problem and clearly there would be a load of issues. If
anyone has some nice links on the subject I'd much appreciate them.
Regards,
Michael.
--
mmeeks gnu org <><, Pseudo Engineer, itinerant idiot
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]