<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Assertive Finalizers</title>
	<atom:link href="http://scottbilas.com/blog/assertive-finalizers/feed/" rel="self" type="application/rss+xml" />
	<link>http://scottbilas.com/blog/assertive-finalizers/</link>
	<description>Take what you want, and leave the rest (just like your salad bar).</description>
	<lastBuildDate>Mon, 06 Feb 2012 03:15:56 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Viola_gord</title>
		<link>http://scottbilas.com/blog/assertive-finalizers/#comment-1783</link>
		<dc:creator>Viola_gord</dc:creator>
		<pubDate>Mon, 06 Feb 2012 03:15:56 +0000</pubDate>
		<guid isPermaLink="false">http://scottbilas.com/?p=485#comment-1783</guid>
		<description>roundmound of ass ass fuck big tits porn fucking clip free live xxx cams male 100 blowjobs vol 7 bdsm under his hand free naked woman soft porn gallery sick videos ass fallss out loita porn 100 sex over sex free japanise porn pick sex letter free quicktime sex movie buttcracks porn ass reamers 3 psp free porn porndownloads alexia pregnant porn galleries dirty nonk porn thats ass online sex video search engine</description>
		<content:encoded><![CDATA[<p>roundmound of ass ass fuck big tits porn fucking clip free live xxx cams male 100 blowjobs vol 7 bdsm under his hand free naked woman soft porn gallery sick videos ass fallss out loita porn 100 sex over sex free japanise porn pick sex letter free quicktime sex movie buttcracks porn ass reamers 3 psp free porn porndownloads alexia pregnant porn galleries dirty nonk porn thats ass online sex video search engine</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scott</title>
		<link>http://scottbilas.com/blog/assertive-finalizers/#comment-730</link>
		<dc:creator>Scott</dc:creator>
		<pubDate>Wed, 01 Dec 2010 04:43:46 +0000</pubDate>
		<guid isPermaLink="false">http://scottbilas.com/?p=485#comment-730</guid>
		<description>All very good points, thanks for your reply.

As I mainly do internal tools, the reactive bugfix approach has always been fine. Though I&#039;d say the same for even production tools - this article is about reporting leaks, which is a debug feature, so we&#039;d not want it to compile in release builds anyway. I&#039;d just wrap the GC calls in #if DEBUG and call it good. :)</description>
		<content:encoded><![CDATA[<p>All very good points, thanks for your reply.</p>
<p>As I mainly do internal tools, the reactive bugfix approach has always been fine. Though I&#8217;d say the same for even production tools &#8211; this article is about reporting leaks, which is a debug feature, so we&#8217;d not want it to compile in release builds anyway. I&#8217;d just wrap the GC calls in #if DEBUG and call it good. <img src='http://scottbilas.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David</title>
		<link>http://scottbilas.com/blog/assertive-finalizers/#comment-728</link>
		<dc:creator>David</dc:creator>
		<pubDate>Tue, 30 Nov 2010 21:54:47 +0000</pubDate>
		<guid isPermaLink="false">http://scottbilas.com/?p=485#comment-728</guid>
		<description>To my knowledge there are a number of other ways in which WaitForPendingFinalizers will block other than constant object resurrections keeping the finalizer queue from getting empty (I&#039;ve never seen anyone try to resurrect their object through the finalizer... that would be pretty strange/evil/scary).  For instance:
* The finalizer thread blocks because any finalizer it is running blocks.
* The finalizer thread blocks because it needs to marshal to the UI thread and:
** The UI thread is no longer pumping messages (IE at program shutdown time which is precicely when we&#039;re calling it with this pattern - some COM objects may cause this).
** The UI thread is also WaitForPendingFinalizers... or some other deadlock/blocking condition.

But all of the above is irrelevant.  The fact is, the documentation says WaitForPendingFinalizers is not guaranteed to exit, so we can&#039;t rely on it to exit.  Lets say some Windows Update or more likely a new .NET version comes along and changes the behavior a little bit but still abides by the documentated behaviors... just look at how many people changes like the .NET 1.1 to .NET 2.0 changes broke because they were relying on undocumented behaviors of GC.Collect and WaitForPendingFinalizers.  Relying on undocumented behaviors (even &quot;good&quot; ones such as situations where it _didn&#039;t_ used to block) means that such updates are free to break our code w/out apologies.

That said, the simplicity of the two-line approach you use is certainly worth taking a reactive bugfix approach to, so long as the tool is internal or whatnot.  I wouldn&#039;t have implemented the Thread approach if I hadn&#039;t seen the problem firsthand.</description>
		<content:encoded><![CDATA[<p>To my knowledge there are a number of other ways in which WaitForPendingFinalizers will block other than constant object resurrections keeping the finalizer queue from getting empty (I&#8217;ve never seen anyone try to resurrect their object through the finalizer&#8230; that would be pretty strange/evil/scary).  For instance:<br />
* The finalizer thread blocks because any finalizer it is running blocks.<br />
* The finalizer thread blocks because it needs to marshal to the UI thread and:<br />
** The UI thread is no longer pumping messages (IE at program shutdown time which is precicely when we&#8217;re calling it with this pattern &#8211; some COM objects may cause this).<br />
** The UI thread is also WaitForPendingFinalizers&#8230; or some other deadlock/blocking condition.</p>
<p>But all of the above is irrelevant.  The fact is, the documentation says WaitForPendingFinalizers is not guaranteed to exit, so we can&#8217;t rely on it to exit.  Lets say some Windows Update or more likely a new .NET version comes along and changes the behavior a little bit but still abides by the documentated behaviors&#8230; just look at how many people changes like the .NET 1.1 to .NET 2.0 changes broke because they were relying on undocumented behaviors of GC.Collect and WaitForPendingFinalizers.  Relying on undocumented behaviors (even &#8220;good&#8221; ones such as situations where it _didn&#8217;t_ used to block) means that such updates are free to break our code w/out apologies.</p>
<p>That said, the simplicity of the two-line approach you use is certainly worth taking a reactive bugfix approach to, so long as the tool is internal or whatnot.  I wouldn&#8217;t have implemented the Thread approach if I hadn&#8217;t seen the problem firsthand.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scott</title>
		<link>http://scottbilas.com/blog/assertive-finalizers/#comment-727</link>
		<dc:creator>Scott</dc:creator>
		<pubDate>Tue, 30 Nov 2010 05:38:40 +0000</pubDate>
		<guid isPermaLink="false">http://scottbilas.com/?p=485#comment-727</guid>
		<description>WaitForPendingFinalizers won&#039;t exit if objects keep resurrecting themselves or doing other weird things in their finalizers. To me that signifies a design flaw in the code. Should be ultra rare and in fact I&#039;ve never seen it happen myself.

I suppose if I did see it a few times I&#039;d do the start/join/abort you mention, and have the code file a minidump with the bugbase before the abort as a high severity issue.</description>
		<content:encoded><![CDATA[<p>WaitForPendingFinalizers won&#8217;t exit if objects keep resurrecting themselves or doing other weird things in their finalizers. To me that signifies a design flaw in the code. Should be ultra rare and in fact I&#8217;ve never seen it happen myself.</p>
<p>I suppose if I did see it a few times I&#8217;d do the start/join/abort you mention, and have the code file a minidump with the bugbase before the abort as a high severity issue.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David</title>
		<link>http://scottbilas.com/blog/assertive-finalizers/#comment-726</link>
		<dc:creator>David</dc:creator>
		<pubDate>Tue, 30 Nov 2010 03:32:08 +0000</pubDate>
		<guid isPermaLink="false">http://scottbilas.com/?p=485#comment-726</guid>
		<description>Hi, I&#039;m using a similar approach.  Note that, as per the MSDN documentation, GC.WaitForPendingFinalizers is NOT guaranteed to exit, ever.  I&#039;ve seen it block and had to accommodate for this behavior with something like the following:  house GC.WaitForPendingFinalizers in a try-catch(ThreadAbortException) in a temporary new Thread.  Start, Join(w/timeout), Abort.

At this point, it may make sense to house this functionality so it can be called with one line of code from, say, a static method like:
static void SafeDisposer.ValidateDisposals(timeout) {...}</description>
		<content:encoded><![CDATA[<p>Hi, I&#8217;m using a similar approach.  Note that, as per the MSDN documentation, GC.WaitForPendingFinalizers is NOT guaranteed to exit, ever.  I&#8217;ve seen it block and had to accommodate for this behavior with something like the following:  house GC.WaitForPendingFinalizers in a try-catch(ThreadAbortException) in a temporary new Thread.  Start, Join(w/timeout), Abort.</p>
<p>At this point, it may make sense to house this functionality so it can be called with one line of code from, say, a static method like:<br />
static void SafeDisposer.ValidateDisposals(timeout) {&#8230;}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Quickie: Adding Utility Functions To Interfaces at New Fun Blog &#8211; Scott Bilas</title>
		<link>http://scottbilas.com/blog/assertive-finalizers/#comment-441</link>
		<dc:creator>Quickie: Adding Utility Functions To Interfaces at New Fun Blog &#8211; Scott Bilas</dc:creator>
		<pubDate>Thu, 25 Mar 2010 05:55:26 +0000</pubDate>
		<guid isPermaLink="false">http://scottbilas.com/?p=485#comment-441</guid>
		<description>[...] I say “rich base class”. First is for mixing in object functionality. I’ve spoken about this before. There really is no way to do this nicely in C#. However, today’s post is about the other thing [...]</description>
		<content:encoded><![CDATA[<p>[...] I say “rich base class”. First is for mixing in object functionality. I’ve spoken about this before. There really is no way to do this nicely in C#. However, today’s post is about the other thing [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>

