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 / .NET Framework / New Users / May 2005

Tip: Looking for answers? Try searching our database.

Reference Count

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Arthur M. - 11 May 2005 17:20 GMT
Does anyone know of a way to gain access to runtime's reference counters? GC
keeps track of references...  how do i gain access to them though.
Willy Denoyette [MVP] - 11 May 2005 17:26 GMT
> Does anyone know of a way to gain access to runtime's reference counters?
> GC
> keeps track of references...  how do i gain access to them though.

The run time doesn't use reference counters for managed objects, it keeps
track of managed references, and the GC collect those objects that do not
have roots.

Willy.
Arthur M. - 11 May 2005 18:02 GMT
Is there a way to gain access to managed references list then?
What I need to do is to allow an object to know when all reference to it are
gone.

The core of the problem is Async IO & Garbage collection; if a socket or a
network stream initiated Async io call, until it completes Garbage collector
will ignore it. Which makes it very problematic for objects with lost
references.

I.E. If i loose a reference to an object (or object tree) which is utilizing
IOCP, there is no way for me to get the object closed other then kill the
process.
If I were to have access to references to a particular object (socket in my
case) then I would be able to check them periodically, and if refrence is
lost I can initiate a call to socket shutdown.

I suspect any device bound to an operating system handle will experience the
same issue.

> > Does anyone know of a way to gain access to runtime's reference counters?
> > GC
[quoted text clipped - 5 lines]
>
> Willy.
Lloyd Dupont - 12 May 2005 00:35 GMT
I don't get you..
why do you lost the reference? what do you mean?

if you want to keep track of this socket and close it eventually, why don't
you create a reference to it?
or if there is heaps of them a colection with some time information?
also socket have a timeout, I believe, and you could change it
programatically...

> Is there a way to gain access to managed references list then?
> What I need to do is to allow an object to know when all reference to it
[quoted text clipped - 30 lines]
>>
>> Willy.

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.