<?xml version="1.0" encoding="UTF-8"?><item><title>Pumping</title><description>&lt;DIV&gt;&lt;FONT face=Tahoma size=2&gt;&lt;FONT face="Times New Roman" size=3&gt;An interesting snippet from Chris's last post:&lt;/FONT&gt;&lt;/FONT&gt;&lt;/DIV&gt;&#13;
&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;&#13;
&lt;DIV&gt;&lt;FONT face=Tahoma size=2&gt;A light-weight way to pump is to call Thread.CurrentThread.Join(0).&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;This causes the current thread to block until the current thread dies (which isn&amp;#8217;t going to happen) or until 0 milliseconds have elapsed &amp;#8211; whichever happens first.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;I&amp;#8217;ll explain later why this also performs &lt;I style="mso-bidi-font-style: normal"&gt;some&lt;/I&gt; pumping and why this is a controversial aspect of the CLR.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;A heavier-weight way to pump is to call GC.WaitForPendingFinalizers.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;This not only performs pumping, but it also waits for the Finalization queue to drain.&lt;/FONT&gt;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;&#13;
&lt;DIV dir=ltr&gt;That actually sounds fairly useful.&amp;nbsp; And it's undocumented.&amp;nbsp; Doh.&amp;nbsp; That means people will use it, and it'll end up either breaking apps, or being something they have to support forever.&lt;/DIV&gt;&#13;
&lt;DIV dir=ltr&gt;&amp;nbsp;&lt;/DIV&gt;</description><pubDate>Thu, 01 Sep 2005 19:17:06 GMT</pubDate></item>