<?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 for GrumpyDev</title>
	<atom:link href="http://www.grumpydev.com/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.grumpydev.com</link>
	<description>The Technical Jibber Jabber of Steven Robbins</description>
	<lastBuildDate>Thu, 11 Mar 2010 20:11:29 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>Comment on Surface SDK on Vista x64 by Peter Brady</title>
		<link>http://www.grumpydev.com/2008/12/26/surface-sdk-on-vista-x64/comment-page-1/#comment-212</link>
		<dc:creator>Peter Brady</dc:creator>
		<pubDate>Thu, 11 Mar 2010 20:11:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.grumpydev.com/2008/12/26/surface-sdk-on-vista-x64/#comment-212</guid>
		<description>I had the same problem as Vasco. It looks like the version of the simulator we have installs the simulator in not one but two directories. Make sure you run the corflags fix in both

C:\Program Files (x86)\Microsoft SDKs\Surface\v1.0 and
C:\Program Files (x86)\Microsoft Surface\v1.0</description>
		<content:encoded><![CDATA[<p>I had the same problem as Vasco. It looks like the version of the simulator we have installs the simulator in not one but two directories. Make sure you run the corflags fix in both</p>
<p>C:\Program Files (x86)\Microsoft SDKs\Surface\v1.0 and<br />
C:\Program Files (x86)\Microsoft Surface\v1.0</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Automated &#8220;Unit&#8221; Testing &#8211; It&#8217;s Not Just for TDD, It&#8217;s for Bug Fixing Too! by Marc Gravell</title>
		<link>http://www.grumpydev.com/2010/03/09/automated-unit-testing-its-not-just-for-tdd-its-for-bug-fixing-too/comment-page-1/#comment-208</link>
		<dc:creator>Marc Gravell</dc:creator>
		<pubDate>Tue, 09 Mar 2010 13:26:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.grumpydev.com/?p=293#comment-208</guid>
		<description>Agreed - this is the sane way of doing it; you get an instant regression suite for free (so you don&#039;t keep fixing the same bugs).</description>
		<content:encoded><![CDATA[<p>Agreed &#8211; this is the sane way of doing it; you get an instant regression suite for free (so you don&#8217;t keep fixing the same bugs).</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Announcing: TinyIoC &#8211; An Easy to Use, Hassle Free, Inversion of Control Container by Weekly Links #95 &#124; GrantPalin.com</title>
		<link>http://www.grumpydev.com/2010/03/02/announcing-tinyioc-an-easy-to-use-hassle-free-inversion-of-control-container/comment-page-1/#comment-206</link>
		<dc:creator>Weekly Links #95 &#124; GrantPalin.com</dc:creator>
		<pubDate>Mon, 08 Mar 2010 00:36:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.grumpydev.com/?p=288#comment-206</guid>
		<description>[...] Announcing: TinyIoC – An Easy to Use, Hassle Free, Inversion of Control Container Yet another IoC container for .NET. Sounds interesting though, will dig into it. [...]</description>
		<content:encoded><![CDATA[<p>[...] Announcing: TinyIoC – An Easy to Use, Hassle Free, Inversion of Control Container Yet another IoC container for .NET. Sounds interesting though, will dig into it. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Announcing: TinyIoC &#8211; An Easy to Use, Hassle Free, Inversion of Control Container by srobbins</title>
		<link>http://www.grumpydev.com/2010/03/02/announcing-tinyioc-an-easy-to-use-hassle-free-inversion-of-control-container/comment-page-1/#comment-204</link>
		<dc:creator>srobbins</dc:creator>
		<pubDate>Fri, 05 Mar 2010 14:42:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.grumpydev.com/?p=288#comment-204</guid>
		<description>I&#039;ve changed AutoRegister so you can now get it to throw a meaningful exception if there&#039;s duplicates. The exception message shows the interface/base class that has the clash, and also a comma separated list of all the potential implementations.

I could take that IEnumerable&lt;Type&gt; and pass it into a user specified delegate, but I&#039;m not sure whether that&#039;s taking AutoRegister too far or not - if there&#039;s definite logic you need in your registrations, or if you need named registrations etc., then you might be best either switching to just Register, or mixing AutoRegister with some specific Register commands afterwards?</description>
		<content:encoded><![CDATA[<p>I&#8217;ve changed AutoRegister so you can now get it to throw a meaningful exception if there&#8217;s duplicates. The exception message shows the interface/base class that has the clash, and also a comma separated list of all the potential implementations.</p>
<p>I could take that IEnumerable<type> and pass it into a user specified delegate, but I&#8217;m not sure whether that&#8217;s taking AutoRegister too far or not &#8211; if there&#8217;s definite logic you need in your registrations, or if you need named registrations etc., then you might be best either switching to just Register, or mixing AutoRegister with some specific Register commands afterwards?</type></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Announcing: TinyIoC &#8211; An Easy to Use, Hassle Free, Inversion of Control Container by srobbins</title>
		<link>http://www.grumpydev.com/2010/03/02/announcing-tinyioc-an-easy-to-use-hassle-free-inversion-of-control-container/comment-page-1/#comment-203</link>
		<dc:creator>srobbins</dc:creator>
		<pubDate>Fri, 05 Mar 2010 14:39:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.grumpydev.com/?p=288#comment-203</guid>
		<description>Thanks for the comment, that T4 thing is pretty cool :-)

You can mix and match AutoRegister and Register, and even AutoRegister more than one assembly, so you could AutoRegister your common library first, then do it against your app assembly to copy over any customisations you have in there.</description>
		<content:encoded><![CDATA[<p>Thanks for the comment, that T4 thing is pretty cool <img src='http://www.grumpydev.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>You can mix and match AutoRegister and Register, and even AutoRegister more than one assembly, so you could AutoRegister your common library first, then do it against your app assembly to copy over any customisations you have in there.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Announcing: TinyIoC &#8211; An Easy to Use, Hassle Free, Inversion of Control Container by Harry M</title>
		<link>http://www.grumpydev.com/2010/03/02/announcing-tinyioc-an-easy-to-use-hassle-free-inversion-of-control-container/comment-page-1/#comment-202</link>
		<dc:creator>Harry M</dc:creator>
		<pubDate>Fri, 05 Mar 2010 14:17:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.grumpydev.com/?p=288#comment-202</guid>
		<description>How about make it even more configurable:

container.AutoRegister().AmbiguousResolutionBehaviour(types =&gt; types.First())

container.AutoRegister().AmbiguousResolutionBehaviour(types =&gt; throw new AmbiguousResolutionException(types))

container.AutoRegister().AmbiguousResolutionBehaviour(MyCustomMethodForResolvingWhichOneIWant)</description>
		<content:encoded><![CDATA[<p>How about make it even more configurable:</p>
<p>container.AutoRegister().AmbiguousResolutionBehaviour(types =&gt; types.First())</p>
<p>container.AutoRegister().AmbiguousResolutionBehaviour(types =&gt; throw new AmbiguousResolutionException(types))</p>
<p>container.AutoRegister().AmbiguousResolutionBehaviour(MyCustomMethodForResolvingWhichOneIWant)</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Announcing: TinyIoC &#8211; An Easy to Use, Hassle Free, Inversion of Control Container by Harry M</title>
		<link>http://www.grumpydev.com/2010/03/02/announcing-tinyioc-an-easy-to-use-hassle-free-inversion-of-control-container/comment-page-1/#comment-201</link>
		<dc:creator>Harry M</dc:creator>
		<pubDate>Fri, 05 Mar 2010 14:13:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.grumpydev.com/?p=288#comment-201</guid>
		<description>Like it. You can keep it up to date with this http://www.adverseconditionals.com/2010/01/easy-peasy-web-dependencies-using-t4.html :)

It&#039;d be pretty cool if, when faced with multiple implementations, it picked up the one in the launch assembly first. This way you can have a default implementation of a service in a common library, but override it in your different applications.</description>
		<content:encoded><![CDATA[<p>Like it. You can keep it up to date with this <a href="http://www.adverseconditionals.com/2010/01/easy-peasy-web-dependencies-using-t4.html" rel="nofollow">http://www.adverseconditionals.com/2010/01/easy-peasy-web-dependencies-using-t4.html</a> <img src='http://www.grumpydev.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>It&#8217;d be pretty cool if, when faced with multiple implementations, it picked up the one in the launch assembly first. This way you can have a default implementation of a service in a common library, but override it in your different applications.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Why Shouldn&#8217;t I use PRISM? by Jason</title>
		<link>http://www.grumpydev.com/2009/07/04/why-shouldn%e2%80%99t-i-use-prism/comment-page-1/#comment-200</link>
		<dc:creator>Jason</dc:creator>
		<pubDate>Thu, 04 Mar 2010 17:46:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.grumpydev.com/?p=201#comment-200</guid>
		<description>Not sure why we need modules. Whats wrong with Unity being able to manage loading of the circular dependencies among services? I wrote my own - and it can handle this. Its simple enough - lock around the service being resitered - place into container for duration of lock - create dependencies inside that lock (hey they can see me cos its inside my lock) - voila - circulars all done. close lock. So why do we need modules? Unfrotunately - that&#039;s why i wrote my own - prism is a massive lump of rot on top of what could have been simple and elegant.  you never needed modules - they are what the rest of us call assemblies.</description>
		<content:encoded><![CDATA[<p>Not sure why we need modules. Whats wrong with Unity being able to manage loading of the circular dependencies among services? I wrote my own &#8211; and it can handle this. Its simple enough &#8211; lock around the service being resitered &#8211; place into container for duration of lock &#8211; create dependencies inside that lock (hey they can see me cos its inside my lock) &#8211; voila &#8211; circulars all done. close lock. So why do we need modules? Unfrotunately &#8211; that&#8217;s why i wrote my own &#8211; prism is a massive lump of rot on top of what could have been simple and elegant.  you never needed modules &#8211; they are what the rest of us call assemblies.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Announcing: TinyIoC &#8211; An Easy to Use, Hassle Free, Inversion of Control Container by srobbins</title>
		<link>http://www.grumpydev.com/2010/03/02/announcing-tinyioc-an-easy-to-use-hassle-free-inversion-of-control-container/comment-page-1/#comment-199</link>
		<dc:creator>srobbins</dc:creator>
		<pubDate>Thu, 04 Mar 2010 14:32:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.grumpydev.com/?p=288#comment-199</guid>
		<description>I think I&#039;d like to keep the default to be &quot;ignoring&quot; duplicates, but it&#039;s a nice idea to add an option for it - either that or return a boolean for whether any issues were found, then it&#039;s up to you whether you do anything about it or not?

I&#039;ll also add support for abstract base classes too, in the same way that interfaces get added.</description>
		<content:encoded><![CDATA[<p>I think I&#8217;d like to keep the default to be &#8220;ignoring&#8221; duplicates, but it&#8217;s a nice idea to add an option for it &#8211; either that or return a boolean for whether any issues were found, then it&#8217;s up to you whether you do anything about it or not?</p>
<p>I&#8217;ll also add support for abstract base classes too, in the same way that interfaces get added.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Announcing: TinyIoC &#8211; An Easy to Use, Hassle Free, Inversion of Control Container by Craig Stuntz</title>
		<link>http://www.grumpydev.com/2010/03/02/announcing-tinyioc-an-easy-to-use-hassle-free-inversion-of-control-container/comment-page-1/#comment-198</link>
		<dc:creator>Craig Stuntz</dc:creator>
		<pubDate>Thu, 04 Mar 2010 14:24:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.grumpydev.com/?p=288#comment-198</guid>
		<description>What about container.AutoRegister(DuplicateOption.ThrowException) / AutoRegister(DuplicateOption.Ignore)?</description>
		<content:encoded><![CDATA[<p>What about container.AutoRegister(DuplicateOption.ThrowException) / AutoRegister(DuplicateOption.Ignore)?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Passing Parameters using LoadControl() by Jon</title>
		<link>http://www.grumpydev.com/2009/01/05/passing-parameters-using-loadcontrol/comment-page-1/#comment-196</link>
		<dc:creator>Jon</dc:creator>
		<pubDate>Wed, 03 Mar 2010 20:51:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.grumpydev.com/?p=48#comment-196</guid>
		<description>I loves reflection... thanks for the post!</description>
		<content:encoded><![CDATA[<p>I loves reflection&#8230; thanks for the post!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on So What Is This &#8220;Thread Safe&#8221; Thing Anyway? by Andrew Jones</title>
		<link>http://www.grumpydev.com/2010/02/26/so-what-is-this-thread-safe-thing-anyway/comment-page-1/#comment-195</link>
		<dc:creator>Andrew Jones</dc:creator>
		<pubDate>Wed, 03 Mar 2010 09:19:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.grumpydev.com/?p=273#comment-195</guid>
		<description>Eric Lippert says a similar thing here: http://blogs.msdn.com/ericlippert/archive/2009/10/19/what-is-this-thing-you-call-thread-safe.aspx</description>
		<content:encoded><![CDATA[<p>Eric Lippert says a similar thing here: <a href="http://blogs.msdn.com/ericlippert/archive/2009/10/19/what-is-this-thing-you-call-thread-safe.aspx" rel="nofollow">http://blogs.msdn.com/ericlippert/archive/2009/10/19/what-is-this-thing-you-call-thread-safe.aspx</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Announcing: TinyIoC &#8211; An Easy to Use, Hassle Free, Inversion of Control Container by John(no) Nolan</title>
		<link>http://www.grumpydev.com/2010/03/02/announcing-tinyioc-an-easy-to-use-hassle-free-inversion-of-control-container/comment-page-1/#comment-191</link>
		<dc:creator>John(no) Nolan</dc:creator>
		<pubDate>Tue, 02 Mar 2010 09:55:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.grumpydev.com/?p=288#comment-191</guid>
		<description>Really enjoying your posts recently Steve. Read half the code last night of TinyIoC and for it looks great. Didn&#039;t understand why you&#039;d put in all in one .cs until this post. Looking forward to the series.</description>
		<content:encoded><![CDATA[<p>Really enjoying your posts recently Steve. Read half the code last night of TinyIoC and for it looks great. Didn&#8217;t understand why you&#8217;d put in all in one .cs until this post. Looking forward to the series.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Announcing: TinyIoC &#8211; An Easy to Use, Hassle Free, Inversion of Control Container by Will</title>
		<link>http://www.grumpydev.com/2010/03/02/announcing-tinyioc-an-easy-to-use-hassle-free-inversion-of-control-container/comment-page-1/#comment-190</link>
		<dc:creator>Will</dc:creator>
		<pubDate>Tue, 02 Mar 2010 09:01:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.grumpydev.com/?p=288#comment-190</guid>
		<description>It all looks pretty sweet and I love some of the ideas.  Great work!</description>
		<content:encoded><![CDATA[<p>It all looks pretty sweet and I love some of the ideas.  Great work!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Announcing: TinyIoC &#8211; An Easy to Use, Hassle Free, Inversion of Control Container by The Morning Brew - Chris Alcock &#187; The Morning Brew #550</title>
		<link>http://www.grumpydev.com/2010/03/02/announcing-tinyioc-an-easy-to-use-hassle-free-inversion-of-control-container/comment-page-1/#comment-189</link>
		<dc:creator>The Morning Brew - Chris Alcock &#187; The Morning Brew #550</dc:creator>
		<pubDate>Tue, 02 Mar 2010 08:29:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.grumpydev.com/?p=288#comment-189</guid>
		<description>[...] Announcing: TinyIoC - An Easy to Use, Hassle Free, Inversion of Control Container - Steven Robbins announces his current &#8216;Pet Project&#8217; to build a simple Inversion of Control Framework, and accompanying blog post series showing it in use and illustrating IOC concepts. Full source is available for this simple IOC container, and reader comments and suggestions are welcome. [...]</description>
		<content:encoded><![CDATA[<p>[...] Announcing: TinyIoC &#8211; An Easy to Use, Hassle Free, Inversion of Control Container &#8211; Steven Robbins announces his current &#8216;Pet Project&#8217; to build a simple Inversion of Control Framework, and accompanying blog post series showing it in use and illustrating IOC concepts. Full source is available for this simple IOC container, and reader comments and suggestions are welcome. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Announcing: TinyIoC &#8211; An Easy to Use, Hassle Free, Inversion of Control Container by srobbins</title>
		<link>http://www.grumpydev.com/2010/03/02/announcing-tinyioc-an-easy-to-use-hassle-free-inversion-of-control-container/comment-page-1/#comment-188</link>
		<dc:creator>srobbins</dc:creator>
		<pubDate>Tue, 02 Mar 2010 08:14:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.grumpydev.com/?p=288#comment-188</guid>
		<description>&quot;Last one wins&quot; in that scenario. I did consider throwing an exception, or even adding named registrations, but thought both of those would be significantly less friendly.

In my mind, if you hit this issue you can either:

a. Get rid of autoregistration and switch to a more &quot;standard&quot; manual approach.
or, my preferred option:
b. Auto-register to get the vast majority of registrations done, then manually register your exceptions:

&lt;code&gt;
container.AutoRegister();
container.Register();
container.Register(&quot;OtherOne&quot;);
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>&#8220;Last one wins&#8221; in that scenario. I did consider throwing an exception, or even adding named registrations, but thought both of those would be significantly less friendly.</p>
<p>In my mind, if you hit this issue you can either:</p>
<p>a. Get rid of autoregistration and switch to a more &#8220;standard&#8221; manual approach.<br />
or, my preferred option:<br />
b. Auto-register to get the vast majority of registrations done, then manually register your exceptions:</p>
<p><code><br />
container.AutoRegister();<br />
container.Register();<br />
container.Register("OtherOne");<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Announcing: TinyIoC &#8211; An Easy to Use, Hassle Free, Inversion of Control Container by Graeme Foster</title>
		<link>http://www.grumpydev.com/2010/03/02/announcing-tinyioc-an-easy-to-use-hassle-free-inversion-of-control-container/comment-page-1/#comment-187</link>
		<dc:creator>Graeme Foster</dc:creator>
		<pubDate>Tue, 02 Mar 2010 07:10:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.grumpydev.com/?p=288#comment-187</guid>
		<description>What happens if there are multiple implementations of IMyInterface in the AutoRegister example?</description>
		<content:encoded><![CDATA[<p>What happens if there are multiple implementations of IMyInterface in the AutoRegister example?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on So What Is This &#8220;Thread Safe&#8221; Thing Anyway? by The Morning Brew - Chris Alcock &#187; The Morning Brew #549</title>
		<link>http://www.grumpydev.com/2010/02/26/so-what-is-this-thread-safe-thing-anyway/comment-page-1/#comment-186</link>
		<dc:creator>The Morning Brew - Chris Alcock &#187; The Morning Brew #549</dc:creator>
		<pubDate>Mon, 01 Mar 2010 08:40:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.grumpydev.com/?p=273#comment-186</guid>
		<description>[...] So What Is This &quot;Thread Safe&quot; Thing Anyway? - Steven Robbins follows on from his previous post on a “Thread Safe” Dictionary implementation with a discussion of what &quot;Thread Safe&quot; means. [...]</description>
		<content:encoded><![CDATA[<p>[...] So What Is This &quot;Thread Safe&quot; Thing Anyway? &#8211; Steven Robbins follows on from his previous post on a “Thread Safe” Dictionary implementation with a discussion of what &quot;Thread Safe&quot; means. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on “Thread safe” Dictionary(TKey,TValue) by So What Is This &#8220;Thread Safe&#8221; Thing Anyway? &#124; GrumpyDev</title>
		<link>http://www.grumpydev.com/2010/02/25/thread-safe-dictionarytkeytvalue/comment-page-1/#comment-185</link>
		<dc:creator>So What Is This &#8220;Thread Safe&#8221; Thing Anyway? &#124; GrumpyDev</dc:creator>
		<pubDate>Fri, 26 Feb 2010 10:25:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.grumpydev.com/?p=264#comment-185</guid>
		<description>[...] on from my previous post about a “Thread Safe” Dictionary, and the subsequent comment from Rajeesh, made me think that perhaps a general post on “thread [...]</description>
		<content:encoded><![CDATA[<p>[...] on from my previous post about a “Thread Safe” Dictionary, and the subsequent comment from Rajeesh, made me think that perhaps a general post on “thread [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on So What Is This &#8220;Thread Safe&#8221; Thing Anyway? by “Thread safe” Dictionary(TKey,TValue) &#124; GrumpyDev</title>
		<link>http://www.grumpydev.com/2010/02/26/so-what-is-this-thread-safe-thing-anyway/comment-page-1/#comment-184</link>
		<dc:creator>“Thread safe” Dictionary(TKey,TValue) &#124; GrumpyDev</dc:creator>
		<pubDate>Fri, 26 Feb 2010 10:18:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.grumpydev.com/?p=273#comment-184</guid>
		<description>[...] Update : Based on a comment on this post I&#8217;ve added a follow up post that covers the question: What is This &#8220;Thread Safe&#8221; Thing Anyway? [...]</description>
		<content:encoded><![CDATA[<p>[...] Update : Based on a comment on this post I&#8217;ve added a follow up post that covers the question: What is This &#8220;Thread Safe&#8221; Thing Anyway? [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on “Thread safe” Dictionary(TKey,TValue) by The Morning Brew - Chris Alcock &#187; The Morning Brew #548</title>
		<link>http://www.grumpydev.com/2010/02/25/thread-safe-dictionarytkeytvalue/comment-page-1/#comment-183</link>
		<dc:creator>The Morning Brew - Chris Alcock &#187; The Morning Brew #548</dc:creator>
		<pubDate>Fri, 26 Feb 2010 08:01:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.grumpydev.com/?p=264#comment-183</guid>
		<description>[...] &quot;Thread safe&quot; Dictionary(TKey,TValue) - GrumpyDev AKA Steven Robbins takes a look at implementing a Thread Safe Dictionary in .NET 3.5 for a pet project, with a view to moving his project to using the .NET 4 concurrent collections dictionary in the future. [...]</description>
		<content:encoded><![CDATA[<p>[...] &quot;Thread safe&quot; Dictionary(TKey,TValue) &#8211; GrumpyDev AKA Steven Robbins takes a look at implementing a Thread Safe Dictionary in .NET 3.5 for a pet project, with a view to moving his project to using the .NET 4 concurrent collections dictionary in the future. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on “Thread safe” Dictionary(TKey,TValue) by srobbins</title>
		<link>http://www.grumpydev.com/2010/02/25/thread-safe-dictionarytkeytvalue/comment-page-1/#comment-182</link>
		<dc:creator>srobbins</dc:creator>
		<pubDate>Fri, 26 Feb 2010 07:19:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.grumpydev.com/?p=264#comment-182</guid>
		<description>Hi Rajeesh,

Of course you are right, but this is generally the case with all &quot;thread safe&quot; classes. We can attempt to guarantee all of our public methods are safe to call concurrently from separate threads, but there&#039;s no way to ensure that *multiple calls* from one thread happen before calls from another. In this scenario you will require an external lock. 

The reason I generally use &quot;thread safe&quot; in quotes is partly for this reason. We can do our best to make our internals safe, but you still need to make sure that your calling code isn&#039;t doing anything inherently unsafe. 

The code you pasted won&#039;t error, you just might not end up with quite the value you expect, but even with your locks in place another thread may overwrite your new value immediately, so the lock in your example seems to add little value.

Thanks,

Steve </description>
		<content:encoded><![CDATA[<p>Hi Rajeesh,</p>
<p>Of course you are right, but this is generally the case with all &#8220;thread safe&#8221; classes. We can attempt to guarantee all of our public methods are safe to call concurrently from separate threads, but there&#8217;s no way to ensure that *multiple calls* from one thread happen before calls from another. In this scenario you will require an external lock. </p>
<p>The reason I generally use &#8220;thread safe&#8221; in quotes is partly for this reason. We can do our best to make our internals safe, but you still need to make sure that your calling code isn&#8217;t doing anything inherently unsafe. </p>
<p>The code you pasted won&#8217;t error, you just might not end up with quite the value you expect, but even with your locks in place another thread may overwrite your new value immediately, so the lock in your example seems to add little value.</p>
<p>Thanks,</p>
<p>Steve</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on “Thread safe” Dictionary(TKey,TValue) by Rajeesh</title>
		<link>http://www.grumpydev.com/2010/02/25/thread-safe-dictionarytkeytvalue/comment-page-1/#comment-181</link>
		<dc:creator>Rajeesh</dc:creator>
		<pubDate>Fri, 26 Feb 2010 06:36:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.grumpydev.com/?p=264#comment-181</guid>
		<description>Hi Steve,

What happens if somebody call the below code from multiple threads

if(safeDictionaryObj[&quot;MyKey&quot;] == &quot;SomeValue&quot;)
{
     safeDictionaryObj[&quot;MyKey&quot;] = &quot;NewValue&quot;;
}

It won&#039;t be working as expected, so we may have to lock the entire if statement again to make it thread safe.

lock(__alockobj)
{
   if(safeDictionaryObj[&quot;MyKey&quot;] == &quot;SomeValue&quot;)
   {
      safeDictionaryObj[&quot;MyKey&quot;] = &quot;NewValue&quot;;
    }
}

So the composition class you have created may not holds good for this scenario.</description>
		<content:encoded><![CDATA[<p>Hi Steve,</p>
<p>What happens if somebody call the below code from multiple threads</p>
<p>if(safeDictionaryObj["MyKey"] == &#8220;SomeValue&#8221;)<br />
{<br />
     safeDictionaryObj["MyKey"] = &#8220;NewValue&#8221;;<br />
}</p>
<p>It won&#8217;t be working as expected, so we may have to lock the entire if statement again to make it thread safe.</p>
<p>lock(__alockobj)<br />
{<br />
   if(safeDictionaryObj["MyKey"] == &#8220;SomeValue&#8221;)<br />
   {<br />
      safeDictionaryObj["MyKey"] = &#8220;NewValue&#8221;;<br />
    }<br />
}</p>
<p>So the composition class you have created may not holds good for this scenario.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Surface SDK SP1 on Vista and Win7 x64 by Chris</title>
		<link>http://www.grumpydev.com/2009/05/17/surface-sdk-sp1-on-vista-and-win7-x64/comment-page-1/#comment-180</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Mon, 22 Feb 2010 13:25:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.grumpydev.com/?p=182#comment-180</guid>
		<description>On my windows 7 x64 the installation progresses until it wants to write something to the registry, and then i fails.</description>
		<content:encoded><![CDATA[<p>On my windows 7 x64 the installation progresses until it wants to write something to the registry, and then i fails.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Localising WPF Applications Using RESX Files and Standard Data Binding (Without a MarkupExtension) by srobbins</title>
		<link>http://www.grumpydev.com/2009/09/08/localising-wpf-applications-using-resx-files-and-standard-data-binding-without-a-markupextension/comment-page-1/#comment-179</link>
		<dc:creator>srobbins</dc:creator>
		<pubDate>Fri, 19 Feb 2010 07:40:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.grumpydev.com/?p=239#comment-179</guid>
		<description>Hello There. You&#039;re right, there&#039;s no way to static checking of normal bindings, you will have to use one of the standard binding debugging techniques (output window or trace listener are the ones I use). I&#039;ve used this technique in quite a large project though and, if you stick to conventions for naming the resources, I haven&#039;t seen any issues with it.</description>
		<content:encoded><![CDATA[<p>Hello There. You&#8217;re right, there&#8217;s no way to static checking of normal bindings, you will have to use one of the standard binding debugging techniques (output window or trace listener are the ones I use). I&#8217;ve used this technique in quite a large project though and, if you stick to conventions for naming the resources, I haven&#8217;t seen any issues with it.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
