<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>Comments for Object Destructors and Finalizers in .NET Using C# and Delphi for .NET</title>
<link rel="alternate" type="text/plain" href="http://dn.codegear.com/article/29365" title="Object Destructors and Finalizers in .NET Using C# and Delphi for .NET" />
<link rel="self" type="application/atom+xml" href="http://dn.codegear.com/article/29365/feed" title="Comments for Object Destructors and Finalizers in .NET Using C# and Delphi for .NET" />
<id>http://dn.codegear.com/article/29365</id>
<updated>2008-10-07T01:39:20-07:00</updated>
<entry>
<title>Object Destructors and Finalizers in .NET Using C# and Delphi for .NET - by Brian Long</title>
<author>
<name>Jimmy Tharpe</name>
<uri>http://threads.codegear.com/threads/threads.exe/userall?commentid=34082</uri>
</author>
<id>http://threads.codegear.com/threads/threads.exe/view?commentid=34082</id>
<updated>2003-02-10T09:27:47-08:00</updated>
<published>2003-02-10T09:27:47-08:00</published>
<summary>Object Destructors and Finalizers in .NET Using C# and Delphi for .NET - by Brian Long</summary>
<content>This is a *great* article. Thanks Brian!</content>
</entry>
<entry>
<title>Good article. Everyone should read.</title>
<author>
<name>Andrew Fionik</name>
<uri>http://threads.codegear.com/threads/threads.exe/userall?commentid=33815</uri>
</author>
<id>http://threads.codegear.com/threads/threads.exe/view?commentid=33815</id>
<updated>2002-12-30T03:18:59-08:00</updated>
<published>2002-12-30T03:18:59-08:00</published>
<summary>Good article. Everyone should read.</summary>
<content>Thanks for great article.</content>
</entry>
<entry>
<title>re: Object Destructors and Finalizers in .NET Using C# and Delphi for .NET - by Brian Long</title>
<author>
<name>Hallvard Vassbotn</name>
<uri>http://threads.codegear.com/threads/threads.exe/userall?commentid=33814</uri>
</author>
<id>http://threads.codegear.com/threads/threads.exe/view?commentid=33814</id>
<updated>2002-12-30T01:57:45-08:00</updated>
<published>2002-12-30T01:57:45-08:00</published>
<summary>re: Object Destructors and Finalizers in .NET Using C# and Delphi for .NET - by Brian Long</summary>
<content>There is no reference counting going on in the .NET garbage collector. Circular references isn't a problem either.Instead of speculating or fantazising, why don't you read up on hard facts instead? Start with the references from Brian's article.</content>
</entry>
<entry>
<title>re: Object Destructors and Finalizers in .NET Using C# and Delphi for .NET - by Brian Long</title>
<author>
<name>C Johnson</name>
<uri>http://threads.codegear.com/threads/threads.exe/userall?commentid=33807</uri>
</author>
<id>http://threads.codegear.com/threads/threads.exe/view?commentid=33807</id>
<updated>2002-12-29T03:30:50-08:00</updated>
<published>2002-12-29T03:30:50-08:00</published>
<summary>re: Object Destructors and Finalizers in .NET Using C# and Delphi for .NET - by Brian Long</summary>
<content>Not every variable can or will cross reference every other variable.. So obviously, the garbage collector will rely on a fairly simple reference counting mechanism, even if it is hidden like Delphi's long string mechanism - esp. if you take in to account the speed at which Microsoft reports the sweeps.Face it, you can't create pyschic code, MS isn't going to guess what you do and don't know, they'll go by reference counting (look at all the things in the VCL your code never knows about, but needs in the background, could you imaging the complexity of deterministic variable tracking, or the result of the smallest flaw in the routine???).  Even if MS doesn't advertize the exact mechanism, you can bet reference counting is going on behind the intermediate language compile...Ultimately, you could probably kill the garbage collector with a simple bidirectional relationship.a references b, b references a...  not matter how hard you try to lose your reference to one or the other, as long as 1 exists, they both exist... If you only lose your reference to the other in the finalization, the finalization would never get called...Why do you think MS is cloaking finization in mystery, determined that we not use the finalization step in this manner?  Probably to prevent exactly this sort of problem being exposed by an inherent weakness of a poor system (In my opinion, automated garbage collection only has value when the application ends or is terminated, and then it should be the OS's responsibility, not the language)</content>
</entry>
<entry>
<title>re: Object Destructors and Finalizers in .NET Using C# and Delphi for .NET - by Brian Long</title>
<author>
<name>Christian NineBerry Schwarz</name>
<uri>http://threads.codegear.com/threads/threads.exe/userall?commentid=33792</uri>
</author>
<id>http://threads.codegear.com/threads/threads.exe/view?commentid=33792</id>
<updated>2002-12-23T04:06:40-08:00</updated>
<published>2002-12-23T04:06:40-08:00</published>
<summary>re: Object Destructors and Finalizers in .NET Using C# and Delphi for .NET - by Brian Long</summary>
<content>Don't think of reference counting when dealing with the .net garbage collector. It uses some kind of mark and sweep algorithm. If you have A referencing B and B referencing C:If A looses its reference to B, then B and C are both no longer considered alive at the same time, because they cannot be reached from &quot;known variables&quot; by following all references. So, the order of finalization of B and C will depend on some not precalculatable conditions (i.e. address in memory).</content>
</entry>
<entry>
<title>Object Destructors and Finalizers in .NET Using C# and Delphi for .NET - by Brian Long</title>
<author>
<name>C Johnson</name>
<uri>http://threads.codegear.com/threads/threads.exe/userall?commentid=33789</uri>
</author>
<id>http://threads.codegear.com/threads/threads.exe/view?commentid=33789</id>
<updated>2002-12-22T09:01:54-08:00</updated>
<published>2002-12-22T09:01:54-08:00</published>
<summary>Object Destructors and Finalizers in .NET Using C# and Delphi for .NET - by Brian Long</summary>
<content>&quot;Whilst the finalizers are called sequentially for the objects in the freachable queue you cannot predict in what order the objects are placed in the queue (that&#8217;s dependant on the order in which the garbage collector discovers they are unreachable, which cannot be determined). This means that you cannot predict which order the finalizers are called. Even when one object with a finalizer holds a reference to another object with a finalizer, the two finalizers could be called in either order.&quot;I keep hearing this, and it annoys me more every time.  If object A holds a reference to object B, you can bet B won't finalize till AFTER A, because B is still REFERENCED by A, and thus B will not be garbage collected, or even considered for finalization until AFTER A is finalized &amp; long gone.The descriptions of how the finalization mechanism works makes this abundantly clear.</content>
</entry>
<entry>
<title>Object Destructors and Finalizers in .NET Using C# and Delphi for .NET - by Brian Long</title>
<author>
<name>Lino Tadros</name>
<uri>http://threads.codegear.com/threads/threads.exe/userall?commentid=33788</uri>
</author>
<id>http://threads.codegear.com/threads/threads.exe/view?commentid=33788</id>
<updated>2002-12-22T07:55:47-08:00</updated>
<published>2002-12-22T07:55:47-08:00</published>
<summary>Object Destructors and Finalizers in .NET Using C# and Delphi for .NET - by Brian Long</summary>
<content>Excellent article, as usual!!</content>
</entry>
</feed>
