Comments on: Playing with a few ReaderWriterLocks in .Net http://v1.ripper234.com/p/playing-with-a-few-readerwriterlocks-in-net/ Stuff Ron Gross Finds Interesting Sun, 02 Aug 2015 11:03:35 +0000 hourly 1 https://wordpress.org/?v=4.5.3 By: ripper234 http://v1.ripper234.com/p/playing-with-a-few-readerwriterlocks-in-net/comment-page-1/#comment-2195 Tue, 11 May 2010 05:38:44 +0000 http://v1.ripper234.com/?p=907#comment-2195 @Eli, I measured how long the test takes to run. While I forgot to attach the test code here, it basically spun a few concurrent reader/writer threads that all had contention on a single lock. They did a very small amount of work inside that lock, then gave it up. If I remember correctly, I had a fixed ratio of readers vs writers. Increasing the number of threads in this case increases the runtime because there is actually more work to do.

In this case I simply wanted to see how well the lock performs under extreme contention. It is not “realistic” – you’d need to think more thoroughly about what exactly you’re trying to measure to get more meaningful results – but even this simplistic testing was interesting in that it exposes differences between the different implementations.

Looking forward to your post on RW locks.

]]>
By: Eli http://v1.ripper234.com/p/playing-with-a-few-readerwriterlocks-in-net/comment-page-1/#comment-2194 Tue, 11 May 2010 04:16:22 +0000 http://v1.ripper234.com/?p=907#comment-2194 Ron,

Nice writeup – I recently looked into RW locks, recalled that you once wrote about it and came back to read it. I’m not sure I understand your performance graph – what are you measuring exactly? Also, are you really creating that many threads – and if so, is it really realistic, or would a better benchmark involve a realistic amount of threads with a vertical load (i.e. large amount of read and write operations to perform)?

]]>