No, you would not. This would still be good enough, imho. With adding
finalizers to structs you are VERY far already.
The overhead for local ref counting is neglegible, imho. Yes, it is
there, but "resources" normally carry a much higher cost themselves, and
you are not going to pass these around by the hundreds.
Regards
Thomas Tomiczek
THONA Consulting Ltd.
(Microsoft MVP C#/.NET)
--
Still writing SQL and dealing with DataSets?
Why dont you use our EntityBroker.
The most advanced o/r and business object toolkit in town.
-----Original Message-----
From: Chris Sells [mailto:csells@;SELLSBROTHERS.COM]
Sent: Mittwoch, 6. November 2002 17:09
To: [EMAIL PROTECTED]
Subject: Re: [ADVANCED-DOTNET] Enforcing IDisposable ownership rules
> That's the core point I wonder about, btw - why have people not put
> reference counting (for resources) ON TOP of GC. Let the GC handle the
> garbage, and let the reference counter handle the "Idispoable"
pattern.
> Add this to "smart templates" for variables and you are gone.
The reason for not adding ref-counting is the performance cost. Our
research project [1] has yielded some preliminary results that indicate
a non-trivial performance degradation when ref-counting is added.
[1] http://www.sellsbrothers.com/spout/#refCountRotor
> BASICALLY - have every reference variable referencing an Idisposable
> implementing style call the correct addref/release functions on the
> Idisposable method (compiler injection) and you are combining both
> advantages.
Unfortunately, you have to ref-count every object, because top-level
objects may have no finalizer, but objects they hold might, or objects
that are held by those objects (etc).
You can read messages from the Advanced DOTNET archive, unsubscribe from
Advanced DOTNET, or subscribe to other DevelopMentor lists at
http://discuss.develop.com.
You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced
DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.