Re: Should the Dispose( ) method only run when there are no other references to an object?
- From: "David Browne" <davidbaxterbrowne no potted meat@xxxxxxxxxxx>
- Date: Sun, 21 Jan 2007 22:32:53 -0600
"Michael C" <nospam@xxxxxxxxxx> wrote in message news:eSZ5zzdPHHA.4924@xxxxxxxxxxxxxxxxxxxxxxx
"Steve Richter" <StephenRichter@xxxxxxxxx> wrote in message news:1169438284.988182.270380@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxthanks for confirming that. I can accept that I have to program for it.
I am thinking that the absence of reference counting from .NET objects
is a failing of its design.
It's not a failing, the very idea was to get rid of ref counting.
To be fair, ref counting is semantically superior, but it's more expensive than garbage collecting.
Can I define a ReferenceCountObject class
that is derived from Object. Then base any class of mine that I want to
maintain a reference count in from that class? How would such a class
work to update the reference count when the object is passed by
reference to a method or added to a list?
It wouldn't. Reference counting would need to be baked into the low-level memory management of .NET so that all those reference assignments operations correctly maintained the reference count.
David
.
- References:
- Should the Dispose( ) method only run when there are no other references to an object?
- From: Steve Richter
- Re: Should the Dispose( ) method only run when there are no other references to an object?
- From: Brian Gideon
- Re: Should the Dispose( ) method only run when there are no other references to an object?
- From: Steve Richter
- Re: Should the Dispose( ) method only run when there are no other references to an object?
- From: Michael C
- Should the Dispose( ) method only run when there are no other references to an object?
- Prev by Date: Re: << and >> operators in c#
- Next by Date: Re: Should the Dispose( ) method only run when there are no other references to an object?
- Previous by thread: Re: Should the Dispose( ) method only run when there are no other references to an object?
- Next by thread: Re: Should the Dispose( ) method only run when there are no other references to an object?
- Index(es):
Relevant Pages
|
Loading