<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://codingcommandos.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>What are we going to do tomorrow night, Brain?  - All Comments</title><link>http://codingcommandos.com/blogs/brianr/default.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2008.5 (Build: 30912.2823)</generator><item><title>(OffTopic) ‘ThreadSafe’ Classes</title><link>http://codingcommandos.com/blogs/brianr/archive/2008/11/26/more-threading-goodness.aspx#16003</link><pubDate>Wed, 03 Aug 2011 00:54:02 GMT</pubDate><guid isPermaLink="false">6e120f4b-f509-4111-8fd8-03bc0d0a75d9:16003</guid><dc:creator>The Activity Designer</dc:creator><description>&lt;p&gt;[Or: Rant - Code-Reviewing Random Code on the Internet.] I&amp;rsquo;m sure I&amp;rsquo;ve stumbled upon this&lt;/p&gt;
&lt;img src="http://codingcommandos.com/aggbug.aspx?PostID=16003" width="1" height="1"&gt;</description></item><item><title>Listen to lil boosie song</title><link>http://codingcommandos.com/blogs/brianr/archive/2008/09/26/thread-safe-dictionary-in-net.aspx#16002</link><pubDate>Fri, 17 Dec 2010 14:52:16 GMT</pubDate><guid isPermaLink="false">6e120f4b-f509-4111-8fd8-03bc0d0a75d9:16002</guid><dc:creator>Listen to lil boosie song</dc:creator><description>&lt;p&gt;Pingback from &amp;nbsp;Listen to lil boosie song&lt;/p&gt;
&lt;img src="http://codingcommandos.com/aggbug.aspx?PostID=16002" width="1" height="1"&gt;</description></item><item><title>Listen to lil boosie song - Boosie ringtone - Boosie</title><link>http://codingcommandos.com/blogs/brianr/archive/2008/09/26/thread-safe-dictionary-in-net.aspx#16001</link><pubDate>Tue, 14 Sep 2010 07:48:05 GMT</pubDate><guid isPermaLink="false">6e120f4b-f509-4111-8fd8-03bc0d0a75d9:16001</guid><dc:creator>Listen to lil boosie song - Boosie ringtone - Boosie</dc:creator><description>&lt;p&gt;Pingback from &amp;nbsp;Listen to lil boosie song - Boosie ringtone - Boosie&lt;/p&gt;
&lt;img src="http://codingcommandos.com/aggbug.aspx?PostID=16001" width="1" height="1"&gt;</description></item><item><title>Lucky charm lyric - Charm lyric - Lucky charms</title><link>http://codingcommandos.com/blogs/brianr/archive/2008/09/26/thread-safe-dictionary-in-net.aspx#16000</link><pubDate>Wed, 08 Sep 2010 00:33:29 GMT</pubDate><guid isPermaLink="false">6e120f4b-f509-4111-8fd8-03bc0d0a75d9:16000</guid><dc:creator>Lucky charm lyric - Charm lyric - Lucky charms</dc:creator><description>&lt;p&gt;Pingback from &amp;nbsp;Lucky charm lyric - Charm lyric - Lucky charms&lt;/p&gt;
&lt;img src="http://codingcommandos.com/aggbug.aspx?PostID=16000" width="1" height="1"&gt;</description></item><item><title>re: Thread Safe Dictionary Update</title><link>http://codingcommandos.com/blogs/brianr/archive/2008/09/29/thread-safe-dictionary-update.aspx#15998</link><pubDate>Thu, 29 Jul 2010 21:32:44 GMT</pubDate><guid isPermaLink="false">6e120f4b-f509-4111-8fd8-03bc0d0a75d9:15998</guid><dc:creator>Brian Rudolph</dc:creator><description>&lt;p&gt;this error is technically being spawned from outside of the dictionary. &amp;nbsp;It says that the thread was being aborted, so I&amp;#39;d imagine that somewhere in your code an ThreadAbort is being done, which put the whole thing in a bit of an iffy state. &amp;nbsp;My guess is that you are perhaps doing some work in a Dispose method that touches the dictionary. &amp;nbsp;I have been using this dictionary for years and have never seen one of these. &amp;nbsp;Do you have a code snippet of how it&amp;#39;s being used?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://codingcommandos.com/aggbug.aspx?PostID=15998" width="1" height="1"&gt;</description></item><item><title>re: Thread Safe Dictionary Update</title><link>http://codingcommandos.com/blogs/brianr/archive/2008/09/29/thread-safe-dictionary-update.aspx#15997</link><pubDate>Mon, 26 Jul 2010 20:33:22 GMT</pubDate><guid isPermaLink="false">6e120f4b-f509-4111-8fd8-03bc0d0a75d9:15997</guid><dc:creator>frJericho</dc:creator><description>&lt;p&gt;I should have added that the one thing that changed is that my application was previously running in a VM with only 1 CPU core and has recently been upgraded to a VM with 2 CPU cores. &lt;/p&gt;
&lt;p&gt;Is it possible that this problem is due to two threads running are attempting to get a lock on the same resource?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://codingcommandos.com/aggbug.aspx?PostID=15997" width="1" height="1"&gt;</description></item><item><title>re: Thread Safe Dictionary Update</title><link>http://codingcommandos.com/blogs/brianr/archive/2008/09/29/thread-safe-dictionary-update.aspx#15996</link><pubDate>Mon, 26 Jul 2010 19:40:11 GMT</pubDate><guid isPermaLink="false">6e120f4b-f509-4111-8fd8-03bc0d0a75d9:15996</guid><dc:creator>frJericho</dc:creator><description>&lt;p&gt;I have been using the Thread Safe dictionary successfully for more than a year but recently I have started seeing more and more of these errors:&lt;/p&gt;
&lt;p&gt;System.Threading.ThreadAbortException: Thread was being aborted.&lt;/p&gt;
&lt;p&gt; &amp;nbsp; at System.Threading.WaitHandle.WaitOneNative(SafeWaitHandle waitHandle, UInt32 millisecondsTimeout, Boolean hasThreadAffinity, Boolean exitContext)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; at System.Threading.WaitHandle.WaitOne(Int64 timeout, Boolean exitContext)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; at System.Threading.ReaderWriterLockSlim.WaitOnEvent(EventWaitHandle waitEvent, UInt32&amp;amp; numWaiters, Int32 millisecondsTimeout)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; at System.Threading.ReaderWriterLockSlim.TryEnterUpgradeableReadLock(Int32 millisecondsTimeout)&lt;/p&gt;
&lt;p&gt;I&amp;#39;m wondering what might be causing this problem???&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://codingcommandos.com/aggbug.aspx?PostID=15996" width="1" height="1"&gt;</description></item><item><title>re: Thread Safe Dictionary Update</title><link>http://codingcommandos.com/blogs/brianr/archive/2008/09/29/thread-safe-dictionary-update.aspx#15995</link><pubDate>Thu, 17 Jun 2010 17:13:15 GMT</pubDate><guid isPermaLink="false">6e120f4b-f509-4111-8fd8-03bc0d0a75d9:15995</guid><dc:creator>Brian Rudolph</dc:creator><description>&lt;p&gt;Good Question... Either would work technically, i was attempting to provide a simple place for anyone to extend the class to allow for timeouts. &amp;nbsp;Never finished the implementation, but it would be simple to do so.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://codingcommandos.com/aggbug.aspx?PostID=15995" width="1" height="1"&gt;</description></item><item><title>re: Thread Safe Dictionary Update</title><link>http://codingcommandos.com/blogs/brianr/archive/2008/09/29/thread-safe-dictionary-update.aspx#15994</link><pubDate>Tue, 15 Jun 2010 08:28:27 GMT</pubDate><guid isPermaLink="false">6e120f4b-f509-4111-8fd8-03bc0d0a75d9:15994</guid><dc:creator>lau_</dc:creator><description>&lt;p&gt;Could you explain why you use:&lt;/p&gt;
&lt;p&gt; &amp;nbsp;while (!lockAcquired)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;lockAcquired = locks.TryEnterWriteLock(1);&lt;/p&gt;
&lt;p&gt;instead of a simple:&lt;/p&gt;
&lt;p&gt; &amp;nbsp;locks.EnterWriteLock();&lt;/p&gt;
&lt;p&gt;?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://codingcommandos.com/aggbug.aspx?PostID=15994" width="1" height="1"&gt;</description></item><item><title>Thread Safe Dictionary in .NET with ReaderWriterLockSlim</title><link>http://codingcommandos.com/blogs/brianr/archive/2008/09/26/thread-safe-dictionary-in-net.aspx#15993</link><pubDate>Thu, 06 May 2010 09:06:35 GMT</pubDate><guid isPermaLink="false">6e120f4b-f509-4111-8fd8-03bc0d0a75d9:15993</guid><dc:creator>DotNetKicks.com</dc:creator><description>&lt;p&gt;You&amp;#39;ve been kicked (a good thing) - Trackback from DotNetKicks.com&lt;/p&gt;
&lt;img src="http://codingcommandos.com/aggbug.aspx?PostID=15993" width="1" height="1"&gt;</description></item><item><title>I don&amp;#8217;t have the mental capacity to understand &amp;laquo;  Malaysian&amp;#039;s Chromosome</title><link>http://codingcommandos.com/blogs/brianr/archive/2008/09/26/thread-safe-dictionary-in-net.aspx#15992</link><pubDate>Fri, 05 Mar 2010 08:56:30 GMT</pubDate><guid isPermaLink="false">6e120f4b-f509-4111-8fd8-03bc0d0a75d9:15992</guid><dc:creator>I don’t have the mental capacity to understand «  Malaysian's Chromosome</dc:creator><description>&lt;p&gt;Pingback from &amp;nbsp;I don&amp;#8217;t have the mental capacity to understand &amp;laquo; &amp;nbsp;Malaysian&amp;#039;s Chromosome&lt;/p&gt;
&lt;img src="http://codingcommandos.com/aggbug.aspx?PostID=15992" width="1" height="1"&gt;</description></item><item><title>WPF for the Web guy</title><link>http://codingcommandos.com/blogs/brianr/archive/2008/09/26/thread-safe-dictionary-in-net.aspx#15990</link><pubDate>Wed, 20 Jan 2010 21:01:59 GMT</pubDate><guid isPermaLink="false">6e120f4b-f509-4111-8fd8-03bc0d0a75d9:15990</guid><dc:creator>mostlylucid</dc:creator><description>&lt;p&gt;WPF for the Web guy&lt;/p&gt;
&lt;img src="http://codingcommandos.com/aggbug.aspx?PostID=15990" width="1" height="1"&gt;</description></item><item><title>Twitter Trackbacks for                 Thread Safe Dictionary in .NET with ReaderWriterLockSlim - What are we going to do tomorrow night, Brain?         [dotnetcommandos.com]        on Topsy.com</title><link>http://codingcommandos.com/blogs/brianr/archive/2008/09/26/thread-safe-dictionary-in-net.aspx#15989</link><pubDate>Thu, 07 Jan 2010 21:46:33 GMT</pubDate><guid isPermaLink="false">6e120f4b-f509-4111-8fd8-03bc0d0a75d9:15989</guid><dc:creator>Twitter Trackbacks for                 Thread Safe Dictionary in .NET with ReaderWriterLockSlim - What are we going to do tomorrow night, Brain?         [dotnetcommandos.com]        on Topsy.com</dc:creator><description>&lt;p&gt;Pingback from &amp;nbsp;Twitter Trackbacks for &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Thread Safe Dictionary in .NET with ReaderWriterLockSlim - What are we going to do tomorrow night, Brain? &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [dotnetcommandos.com] &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;on Topsy.com&lt;/p&gt;
&lt;img src="http://codingcommandos.com/aggbug.aspx?PostID=15989" width="1" height="1"&gt;</description></item><item><title>re: Thread Safe Dictionary Update</title><link>http://codingcommandos.com/blogs/brianr/archive/2008/09/29/thread-safe-dictionary-update.aspx#15988</link><pubDate>Wed, 21 Oct 2009 22:05:49 GMT</pubDate><guid isPermaLink="false">6e120f4b-f509-4111-8fd8-03bc0d0a75d9:15988</guid><dc:creator>dj_axl</dc:creator><description>&lt;p&gt;And to add to PeterZacho&amp;#39;s post...&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;public ThreadSafeDictionary(IDictionary&amp;lt;TKey, TValue&amp;gt; dic)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;using (new WriteLock(this.dictionaryLock))&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;this.dict = new Dictionary&amp;lt;TKey, TValue&amp;gt;(dic);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://codingcommandos.com/aggbug.aspx?PostID=15988" width="1" height="1"&gt;</description></item><item><title>re: Thread Safe Dictionary Update</title><link>http://codingcommandos.com/blogs/brianr/archive/2008/09/29/thread-safe-dictionary-update.aspx#15987</link><pubDate>Wed, 21 Oct 2009 20:21:48 GMT</pubDate><guid isPermaLink="false">6e120f4b-f509-4111-8fd8-03bc0d0a75d9:15987</guid><dc:creator>dj_axl</dc:creator><description>&lt;p&gt;For my use needed to add a cast...&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;public static implicit operator Dictionary&amp;lt;TKey, TValue&amp;gt;(ThreadSafeDictionary&amp;lt;TKey, TValue&amp;gt; tsd)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;using (new ReadOnlyLock(tsd.dictionaryLock))&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return (Dictionary&amp;lt;TKey, TValue&amp;gt;)tsd.dict;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://codingcommandos.com/aggbug.aspx?PostID=15987" width="1" height="1"&gt;</description></item></channel></rss>
