Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / March 2008

Tip: Looking for answers? Try searching our database.

Count Of References on a object

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
parez - 06 Mar 2008 21:31 GMT
Hi,

I am trying to implement a  pooling system Is there any way i can get
a count of references of an object.

I am thinking of basing it on this.

http://aspalliance.com/1131_Understanding_Object_Pooling_in_Microsoft...

Please help and TIA
Peter Duniho - 06 Mar 2008 22:21 GMT
> Hi,
>
> I am trying to implement a  pooling system Is there any way i can get
> a count of references of an object.

What was wrong with the reply you got last time you asked this exact same  
question?  Why are you starting a whole new thread?
parez - 06 Mar 2008 23:09 GMT
On Mar 6, 5:21 pm, "Peter Duniho" <NpOeStPe...@nnowslpianmk.com>
wrote:
> > Hi,
>
[quoted text clipped - 3 lines]
> What was wrong with the reply you got last time you asked this exact same
> question?  Why are you starting a whole new thread?

---- Previous reply-------
.NET prefers explicit Close/Dispose for its connection pools.

I think you should follow their example.

Arne
--------------
I really didnt understand..
Is he trying to say that objects in th pools must implement
IDisposable. and in my Dispose method inform the Object pool that this
object is available?
Jon Skeet [C# MVP] - 06 Mar 2008 23:22 GMT
> On Mar 6, 5:21 pm, "Peter Duniho" <NpOeStPe...@nnowslpianmk.com>
> wrote:
[quoted text clipped - 13 lines]
> --------------
> I really didnt understand..

If you don't understand an answer, then it's worth saying so rather
than just repeating the question.

> Is he trying to say that objects in th pools must implement
> IDisposable. and in my Dispose method inform the Object pool that this
> object is available?

Yes. You can't get a reference count in .NET, partly because .NET
doesn't use reference counting.

Signature

Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet   Blog: http://www.msmvps.com/jon.skeet
World class .NET training in the UK: http://iterativetraining.co.uk

Arne Vajhøj - 07 Mar 2008 04:12 GMT
> On Mar 6, 5:21 pm, "Peter Duniho" <NpOeStPe...@nnowslpianmk.com>
> wrote:
[quoted text clipped - 13 lines]
> IDisposable. and in my Dispose method inform the Object pool that this
> object is available?

There are other ways.

But doing it the way MS does .NET framework is probably objectively
good (because MS has spend time considering different solutions) and
definitely subjective good (because C# programmers are used to
the pattern).

Arne

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.