[gclist] Integrating GC and Destructors (Finalizers?)
Peter Froehlich
p.froehlich@amc.cube.net
Thu, 14 Mar 1996 20:37:07 +0100
Hi there!
I'm new to this list. Frank Copeland gave me it's address because I'm
currently researching the indicated subject but can't find enough
publications for a good overview or solution.
I give quit a long "statement" on what I'm trying to do below. Sorry if
this is too long for this list.
----- PROBLEM -----
I'm working on an extended version of the Oberon-2 programming language
called "Froderon" for my diploma thesis in computer science. The thesis
involves implementing a working "Froderon" compiler on top of an Oberon-2
compiler, so it's not purely theoretical.
Oberon-2 features GC, usually implemented using a mark-and-sweep
algorithm. Since I also have a C++ background (and came to like the
constructor/destructor "stuff" it provides) I thought it would be a good
idea to incorporate destructors into Oberon-2 (and constructors of course,
for symmetry).
A "destructor" as I see it is just a specially marked method (type-bound
procedure in "Oberon-2 speech") which will be called by the GC during the
sweep phase.
The problem I'm facing is determining or rather guaranteeing a certain
order in which the objects will be "destroyed", ie. the order of
destructor-calls made by the GC in a network of objects.
Since I can't see a way to guarantee an order without introducing
"strange" things (eg. priorities on pointers) into the language, I'm now
pretty much convinced that the sentence "The order in which destructors are
called are implementation dependent" will make it into the language
definition.
However I doubt that the whole concept will be very useful if I can't
guarantee an order in the first place.
----- PROBLEM -----
If you know of any publications related to GC and treating the matter
(maybe even my problem) well and in-depth, please mail me about it. If you
have any other idea or know of a language in the ALGOL family where this
problem has been solved somehow, please also mail me or just answer to the
list.
As you might have noticed in the subject line, I'm not sure where the
exact difference between "destructor" and "finalizer" lies. Please explain
or hint me at a suitable FAQ file.
Thanks for taking your time.
By(T)e...
Peter...