Read-many, Write-once lock

  • Thread starter Thread starter Brian Muth
  • Start date Start date
B

Brian Muth

Can someone point me in the direction of a Read-many, Write-once lock that can be used in managed code?

Brian
 
Brian Muth said:
Can someone point me in the direction of a Read-many, Write-once lock that
can be used in managed code?

Take a look at the System.Threading.ReaderWriterLock class.
 
Awesome. Thanks, Alberto. I couldn't see the needle for all the hay!

B
 
Brian said:
Awesome. Thanks, Alberto. I couldn't see the needle for all the hay!

Do realize that the readerwriterlock is flawed in .NET 2.0. A new one,
also with flaws but less, will be released in v3.5

Please do a google search on readerwriterlock and you'll see the
problems. There are work arounds though, though these depend on your
situation: sometimes a spinlock is enough, other times you need a
simple monitor enter/exit.

FB

--
------------------------------------------------------------------------
Lead developer of LLBLGen Pro, the productive O/R mapper for .NET
LLBLGen Pro website: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top