Re: A re-announce on GC's defects
- From: "Bruce Wood" <brucewood@xxxxxxxxxx>
- Date: 18 Jan 2007 22:29:22 -0800
Born wrote:
Object lifetime and resource lifetime are similar, so similar that other
languages (such as C++) put code managing them in the same place - the
destructor. However, GC is not a solution for both: it's a solution for
object lifetime *only*.
You've not responded to this point - it's the fundamental assumption on
which your argument falls flat.
Well, I don't care if they are two different things or not. I want to use
object lifetime to tell its weak references that it's gone.
I don't know nearly as much as Barry on this subject, but I immediately
note a semantic problem here: what do you mean by "gone"?
In C++ you have total control over that concept, and C++ software is
usually designed so that all definitions of "gone" occur simultaneously
in the object's destructor. However, this is an artifact of the
language, not a truism.
Let's take your game, for example. An object representing an adversary
can be killed, "gone" from the point of view of the player, but still
be on a queue somewhere waiting for some post-death processing, so not
yet "gone" from the point of view of the game software. In C#, the
object can have any resources it's holding released, but still have
references to it, in other words, Disposed, or "gone" from the point of
view of being any longer usable. Hopefully, a few nanoseconds after
that the last reference to the object goes out of scope, so now the
object is "gone" from the point of view of the program, but may still
be taking up memory. Then, finally, the GC reclaims it, so it is now
"gone" from all points of view.
So... what do you mean by "gone"?
.
- Follow-Ups:
- Re: A re-announce on GC's defects
- From: Born
- Re: A re-announce on GC's defects
- References:
- A re-announce on GC's defects
- From: Born
- Re: A re-announce on GC's defects
- From: Born
- Re: A re-announce on GC's defects
- From: Barry Kelly
- Re: A re-announce on GC's defects
- From: Born
- A re-announce on GC's defects
- Prev by Date: Re: How to create Raw Image Data
- Next by Date: Re: Simple Inheritance : Creating derived classes from instances of base class.
- Previous by thread: Re: A re-announce on GC's defects
- Next by thread: Re: A re-announce on GC's defects
- Index(es):
Relevant Pages
|