<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.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>A Performance Comparison of ReaderWriterLockSlim with ReaderWriterLock</title><link>http://blogs.msdn.com/pedram/archive/2007/10/07/a-performance-comparison-of-readerwriterlockslim-with-readerwriterlock.aspx</link><description>If you have ever used the System.Threading.ReaderWriterLock to achieve synchronised access to shared resources which are frequently read but infrequently updated then you probably know why we have created a new Reader/Write lock. In this MSDN Magazine’s</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Techy News Blog &amp;raquo; A Performance Comparison of ReaderWriterLockSlim with ReaderWriterLock</title><link>http://blogs.msdn.com/pedram/archive/2007/10/07/a-performance-comparison-of-readerwriterlockslim-with-readerwriterlock.aspx#5347536</link><pubDate>Sun, 07 Oct 2007 21:31:11 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5347536</guid><dc:creator>Techy News Blog » A Performance Comparison of ReaderWriterLockSlim with ReaderWriterLock</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://www.artofbam.com/wordpress/?p=5919"&gt;http://www.artofbam.com/wordpress/?p=5919&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>re: A Performance Comparison of ReaderWriterLockSlim with ReaderWriterLock</title><link>http://blogs.msdn.com/pedram/archive/2007/10/07/a-performance-comparison-of-readerwriterlockslim-with-readerwriterlock.aspx#7110469</link><pubDate>Mon, 14 Jan 2008 21:40:07 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7110469</guid><dc:creator>Robert Mircea</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Considering the above results why would you recommend using ReaderWriterLockSlim instead of the Monitor?&lt;/p&gt;
&lt;p&gt;It seems to me that the monitor is the fastest method performing synchronization of certain code blocks.&lt;/p&gt;
&lt;p&gt;In my application I have Dictionaries which are very frequently read by a high number of threads and occasionally &amp;nbsp;updated by some user. Taking into account the above results, would you still recommend using ReaderWriterLockSlim?&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Robert&lt;/p&gt;</description></item><item><title>re: A Performance Comparison of ReaderWriterLockSlim with ReaderWriterLock</title><link>http://blogs.msdn.com/pedram/archive/2007/10/07/a-performance-comparison-of-readerwriterlockslim-with-readerwriterlock.aspx#7112170</link><pubDate>Tue, 15 Jan 2008 01:01:41 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7112170</guid><dc:creator>pedramr</dc:creator><description>&lt;P&gt;A reader-writer lock allows for multiple concurrent reads to enter a read-lock all at the same time and depending on the scenario, it can significantly improve the overall performance of your application when used instead of a mutual exclusive lock. A read-lock takes a shared lock and a write-lock takes an exclusive lock.&lt;/P&gt;
&lt;P&gt;The new ReaderWriterLockSlim correctly gives priority to write requests therefore only use when reads are frequent and writes are less common.&lt;/P&gt;
&lt;P&gt;Hope that clarifies it.&lt;/P&gt;
&lt;P&gt;Pedram&lt;/P&gt;</description></item><item><title>re: A Performance Comparison of ReaderWriterLockSlim with ReaderWriterLock</title><link>http://blogs.msdn.com/pedram/archive/2007/10/07/a-performance-comparison-of-readerwriterlockslim-with-readerwriterlock.aspx#9245891</link><pubDate>Mon, 22 Dec 2008 01:33:39 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9245891</guid><dc:creator>Rick O'Shay</dc:creator><description>&lt;p&gt;Clearly the Monitor is the preferred mechanism if you only have a couple of simultaneous reader threads. You can have hundreds of threads, the question is how many of those are going to try concurrently read the writable resource? With an average of 10 concurrent accesses, you're going to have to wait an average of 10 times longer than &amp;quot;slim&amp;quot; users. I noticed the &amp;quot;slim&amp;quot; version collects some nice metrics. You may determine you're not bottlenecking, but ironically you might not care that &amp;quot;slim&amp;quot; takes 0.7 times longer and keep using it. &lt;/p&gt;</description></item></channel></rss>