Questions tagged [readerwriterlockslim]

ReaderWriterLockSlim is a class in Microsoft .NET framework which represents a lock that is used to manage access to a resource, allowing multiple threads for reading or exclusive access for writing.

79 questions
0
votes
0 answers

Wrapping ReaderWriterLockSlim in an IDisposable handler

All, It seems really natural to me to use the IDisposable pattern to control a ReaderWriterLockSlim lock, since it allows locks to be cleaned up without the extra cruft of a try/catch block. I notice that there is nothing in the BCL to take care of…
Jon Bates
  • 3,055
  • 2
  • 30
  • 48
-1
votes
2 answers

Synchronize Read Write Collection in .NET

I have an object which holds a collection of items. I want to be able to add items to the collection through an AddItem method and also to go through all of the items in the collection. My object must be thread safe. I am using a…
Ricardo Peres
  • 13,724
  • 5
  • 57
  • 74
-1
votes
1 answer

TPL Tasks and ReaderWriterLockSlim

I've got a strange bug in my current project. Thats why I have two questions: 1) Why does this occur? 2) How do I solve this? Some additional info: I'm running this on a System with a QuadCore CPU (Intel Core2Quad Q9650) I have a Function…
-2
votes
1 answer

System.Threading.ReaderWriterLockSlim

Is it true or false of this sentence? It is optimized for usage where writes from multiple sources are common ReaderWriterLockSlim allows thread to lock for read or write and only one lock. But about many threads - is it allow for 2 threads to…
John
  • 727
  • 2
  • 10
  • 17
1 2 3 4 5
6