<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>
<channel>
	<title>Serge&#039;s Technology View &#187; .net</title>
	<atom:link href="http://blog.dragonsoft.us/tag/net/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.dragonsoft.us</link>
	<description>Talk about Technologies, Software Architecture and Management</description>
	<lastBuildDate>Tue, 31 Jan 2012 01:43:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>File locks or when garbage collection goes bad</title>
		<link>http://blog.dragonsoft.us/2009/03/02/file-locks-or-when-garbage-collection-goes-bad/</link>
		<comments>http://blog.dragonsoft.us/2009/03/02/file-locks-or-when-garbage-collection-goes-bad/#comments</comments>
		<pubDate>Mon, 02 Mar 2009 12:23:41 +0000</pubDate>
		<dc:creator>Serguei Dosyukov</dc:creator>
				<category><![CDATA[Fun stuff with C#]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[cannot delete file]]></category>
		<category><![CDATA[file lock]]></category>
		<category><![CDATA[garbage collection manager]]></category>
		<category><![CDATA[manage garbage collection process]]></category>
		<guid isPermaLink="false">http://blog.dragonsoft.us/?p=842</guid>
		<description><![CDATA[With introduction of garbage collection (System.GC name space) in .Net, life of the Windows programmer become easy &#8211; no need to worry about releasing objects, code become simpler, etc. In &#8220;old&#8221; time one would need to use Interfaces to achieve similar functionality &#8230; <a href="http://blog.dragonsoft.us/2009/03/02/file-locks-or-when-garbage-collection-goes-bad/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>With introduction of <a href="http://en.wikipedia.org/wiki/Garbage_collection_(computer_science)" target="_blank">garbage collection</a> (System.GC name space) in .Net, life of the Windows programmer become easy &#8211; no need to worry about releasing objects, code become simpler, etc.<br />
In &#8220;old&#8221; time one would need to use Interfaces to achieve similar functionality and it does have some advantage even over GC &#8211; immediate garbage collection or release of allocated resources/objects.</p>
<p>When writing code in .Net some of us take many things for granted and not always keep in mind that many operations are performed in the context of the unmanaged code or in the &#8220;old way&#8221;&#8230;</p>
<p>File operations or legacy code wrappers are perfect example.<br />
Just because library is available as managed code, it does not mean that everything has ability to &#8220;self-heal&#8221;.<br />
For example in code file is open for edit with lock being placed.<br />
If the file in not closed explicitly, it would be a responsibility of the owner process to release the lock at the time of releasing associated resources &#8211; when process is destroyed.</p>
<p>With garbage collection, just because we are no longer using/owning the process/object, it does not mean that it has been destroyed immediately after. GC management core will release object when it &#8220;feels&#8221; fit, therefore introducing latency into the process.</p>
<p>Off course, proper way would be to be more careful within the code and make sure any locks are released in managed and predictable way: Open/Close, Lock/Unlock, &#8230; Easy solution, but not always accessible, especially when working with 3rd party libraries.</p>
<p>So instead, we can force GC manager to &#8220;collect garbage&#8221; in-place with the following small code:</p>
<pre class="brush: csharp; title: ; notranslate">// See code follow up below
System.GC.Collect();
System.GC.WaitForPendingFinalizers();</pre>
<p>What does it do?<br />
First call will instruct GC manager to start the process (<a href="http://msdn.microsoft.com/en-us/library/system.gc.collect.aspx" target="_blank">1</a>), while second (<a href="http://msdn.microsoft.com/en-us/library/system.gc.waitforpendingfinalizers.aspx" target="_blank">2</a>) will make sure that we wait for process to be completed.</p>
<p>In the case of the file locks, only after GC has released process which placed the lock in the first place, we can manipulate with the file (ex. delete, rename, move).</p>
<hr/><span style="font-size: 7pt">Copyright &copy; 2012 <strong><a href="http://blog.dragonsoft.us">Serge&#039;s Technology View</a></strong>. This Feed is for personal non-commercial use only.</span>]]></content:encoded>
			<wfw:commentRss>http://blog.dragonsoft.us/2009/03/02/file-locks-or-when-garbage-collection-goes-bad/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>.Net Source is now Open &#8211; part 3</title>
		<link>http://blog.dragonsoft.us/2008/02/22/net-source-is-now-open-part-3/</link>
		<comments>http://blog.dragonsoft.us/2008/02/22/net-source-is-now-open-part-3/#comments</comments>
		<pubDate>Fri, 22 Feb 2008 18:53:01 +0000</pubDate>
		<dc:creator>Serguei Dosyukov</dc:creator>
				<category><![CDATA[Delphi]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[open source]]></category>
		<guid isPermaLink="false">http://blog.dragonsoft.us/2008/02/22/net-source-is-now-open-part-3/</guid>
		<description><![CDATA[This seems to be a week of announcements: HD-DVD and now Microsoft is in the news again. As it was announced Feb 21, 2008 Microsoft announced a set of broad-reaching changes to its technology and business practices to increase the &#8230; <a href="http://blog.dragonsoft.us/2008/02/22/net-source-is-now-open-part-3/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This seems to be a week of announcements: <a href="http://blog.dragonsoft.us/2008/02/21/hd-dvd-v-blu-ray-part-3-story-continues/">HD-DVD</a> and now Microsoft is in the news again.</p>
<p><a target="_blank" href="http://www.microsoft.com/presspass/presskits/interoperability/default.mspx?tapm=A47S11G06">As it was announced Feb 21, 2008</a></p>
<blockquote><p>Microsoft announced a set of broad-reaching changes to its technology and business practices to increase the openness of its products and drive greater interoperability, opportunity and choice. These changes are codified into four new interoperability principles and corresponding actions: 1) ensuring open connections; 2) promoting data portability; 3) enhancing support for industry standards; and 4) fostering more open engagement with customers and the industry, including open source communities.</p></blockquote>
<p>Along with everything else over 30,000 pages of documentation on API has been made public.</p>
<p><a href="http://blog.dragonsoft.us/2008/02/17/net-source-is-now-open-part-2/">As I said earlier</a>, Microsoft seems to make a rough U-turn on their policies after facing a few big lawsuits in EU and many complains from developers community in past few years.</p>
<p>Now Balmer really can put his &#8220;<a target="_blank" href="http://www.youtube.com/watch?v=KMU0tzLwhbE">Developers, Developers, Developers</a>&#8230;&#8221; mantra in the air again.</p>
<hr/><span style="font-size: 7pt">Copyright &copy; 2012 <strong><a href="http://blog.dragonsoft.us">Serge&#039;s Technology View</a></strong>. This Feed is for personal non-commercial use only.</span>]]></content:encoded>
			<wfw:commentRss>http://blog.dragonsoft.us/2008/02/22/net-source-is-now-open-part-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>.Net Source is now Open &#8211; part 2</title>
		<link>http://blog.dragonsoft.us/2008/02/17/net-source-is-now-open-part-2/</link>
		<comments>http://blog.dragonsoft.us/2008/02/17/net-source-is-now-open-part-2/#comments</comments>
		<pubDate>Mon, 18 Feb 2008 03:07:48 +0000</pubDate>
		<dc:creator>Serguei Dosyukov</dc:creator>
				<category><![CDATA[Delphi]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[open source]]></category>
		<guid isPermaLink="false">http://blog.dragonsoft.us/2008/02/17/net-source-is-now-open-part-2/</guid>
		<description><![CDATA[As it appeared Microsoft did not stopped at changing licensing for .Net source code. As it was reported by BetaNews this Friday Now developers no longer need to request access to the binary file format (for Office 2003) documentation in &#8230; <a href="http://blog.dragonsoft.us/2008/02/17/net-source-is-now-open-part-2/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>As it appeared Microsoft did not stopped at changing licensing for .Net source code.</p>
<p>As it was reported by <a target="_blank" href="http://www.betanews.com">BetaNews</a> this Friday</p>
<blockquote><p>Now developers no longer need to request access to the binary file format (for Office 2003) documentation in writing or by mail, the spokesperson said; they can now download all the documentation they need directly from Microsoft</p></blockquote>
<p>Read a full story <a target="_blank" href="http://www.betanews.com/article/Updated_Microsoft_clarifies_its_promise_not_to_sue_for_OOXML/1203096360">here</a>.</p>
<p>PS. There is a small thing in the air &#8211; are all those changes because Bill is stepping aside? Off course not <img src='http://blog.dragonsoft.us/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<hr/><span style="font-size: 7pt">Copyright &copy; 2012 <strong><a href="http://blog.dragonsoft.us">Serge&#039;s Technology View</a></strong>. This Feed is for personal non-commercial use only.</span>]]></content:encoded>
			<wfw:commentRss>http://blog.dragonsoft.us/2008/02/17/net-source-is-now-open-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>.Net Source is now Open? Almost</title>
		<link>http://blog.dragonsoft.us/2008/02/14/net-source-is-now-open-almost/</link>
		<comments>http://blog.dragonsoft.us/2008/02/14/net-source-is-now-open-almost/#comments</comments>
		<pubDate>Thu, 14 Feb 2008 15:09:22 +0000</pubDate>
		<dc:creator>Serguei Dosyukov</dc:creator>
				<category><![CDATA[Delphi]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[open source]]></category>
		<guid isPermaLink="false">http://blog.dragonsoft.us/2008/02/14/net-source-is-now-open-almost/</guid>
		<description><![CDATA[Microsoft was accused for many years in their secrecy about internals of the Frameworks and being overprotective when it comes to the point of someone looking at it. No-one was allowed to look at the code for the purpose of &#8230; <a href="http://blog.dragonsoft.us/2008/02/14/net-source-is-now-open-almost/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Microsoft was accused for many years in their secrecy about internals of the Frameworks and being overprotective when it comes to the point of someone looking at it.</p>
<p>No-one was allowed to look at the code for the purpose of to see how it works.</p>
<p>I, as a Pascal/Delphi developer for many years, enjoyed availability of internal source code of components and system functionality since it was always part of Delphi as we know it.</p>
<p>Well&#8230; it is about to change for MS code as well&#8230; not all the way&#8230; but&#8230;</p>
<p>In <a target="_blank" href="http://www.sdtimes.com/pdf/SDTimesBackIssues/sdtimes192.pdf">SD Times&#8217; &#8220;.Net Source Code Released&#8221; from February 15, 2008</a> it is confirmed that Microsoft is changing its license policy in regard to source from &#8220;The .NET Framework source is licensed under the read-only reference license, the most restrictive of the company’s Shared Source licenses.&#8221; to more open version when &#8220;license does not apply to developers creating non-Windows software that has &#8216;the same or substantially the same features or functionality&#8217; as the .NET Framework.&#8221;</p>
<p>You can find more from <a target="_blank" href="http://weblogs.asp.net/scottgu/archive/2007/10/03/releasing-the-source-code-for-the-net-framework-libraries.aspx">ScottGu&#8217;s Blog</a> along with exploring a new license text itself which is called <a href="http://www.microsoft.com/resources/sharedsource/licensingbasics/referencelicense.mspx">Microsoft Reference License or MS-RL</a>. Scott also provides example of how to enable code reference with Visual Studio 2008.</p>
<p>I am sure there is always a twist in every story, but I think it is a good step forward for Microsoft.</p>
<hr/><span style="font-size: 7pt">Copyright &copy; 2012 <strong><a href="http://blog.dragonsoft.us">Serge&#039;s Technology View</a></strong>. This Feed is for personal non-commercial use only.</span>]]></content:encoded>
			<wfw:commentRss>http://blog.dragonsoft.us/2008/02/14/net-source-is-now-open-almost/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

