Tuesday, April 15, 2008

ReaderWriterLockSlim Performance - Is it really so slim??!!!

Hi,
On the .NET 3.5 Microsoft came up with new object named ReaderWriterLockSlim in order to achieve synchronised access to shared resources and also to improve the profermance issues that the old object (System.Threading.ReaderWriterLock) has.

Pedram Rezaei's wrote on his blog great post on Performance Comparison of ReaderWriterLockSlim.
On his performance tests he found that ReaderWriterLockSlim object is slower then the Monitor object.

Pedram Rezaei's conclusion:
"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.

The new ReaderWriterLockSlim correctly gives priority to write requests therefore only use when reads are frequent and writes are less common."

You can take a look on his post here: A Performance Comparison of ReaderWriterLockSlim with ReaderWriterLock

2 comments:

Anonymous said...

Can anyone recommend the top Network Monitoring software for a small IT service company like mine? Does anyone use Kaseya.com or GFI.com? How do they compare to these guys I found recently: [url=http://www.n-able.com] N-able N-central system management
[/url] ? What is your best take in cost vs performance among those three? I need a good advice please... Thanks in advance!

Unknown said...

Its a very good resources describing WinRT background tasks, Parallel library in .NET .Its really easy to carry with advance features. Thanks for sharing the all important article.
http://www.dapfor.com/en/net-suite/net-grid/features/performance