readerwriterlock

How do I find the lockholder (reader) of my ReaderWriterLock in windbg

I've got a dump of a .Net process that has hung due to a deadlock (the gui thread is no longer responding, and my logs show that some threads have stopped responding). I have taken a snapshot and am now looking through it in windbg, and all threads bar one are waiting for the last one. Looking at that one thread's stacktrace with !clrsta...

ReaderWriterLockSlim vs. Monitor

I have an IDictionary<TKey,TValue> implementation that internally holds n other Dictionary<TKey, TValue> and distributes that insertions by the HashCode of the key to the invidual sub-dictionaries. With 16 sub-dictionaries, the number of collisions is pretty low on a 4-core machine. For parallel insertions, i locked the Add-method with ...

How using readerwriterlock correctly

Hello i need to user writerreaderlock in my method. I want to know how use it correctly. I got a dictionnary of ObjectA public class ObjectA { public ReaderWriterLock RWL {get;set;} public ObjectB obj {get;set;} public ObjectA() { RWL = new ReaderWriterLock(); } } public class ObjectB { int TTL {get;set;} string Value {get;set;} } ...

Synchronize datatable/dataview for read write

Hi All, I have application in .net 2.0 in which I have a DataTable object globally in my application and have different dataviews in whole application. When an action performed i have create many threads lets say 5 in which data is read from different dataview, meanwhile while 2/3 threads are reading data(not all 2 more left to read da...

How to program critical section for reader-writer systems?

Hi, Lets say, I have a reader-writer system where reader and writer are concurrently running. 'a' and 'b' are two shared variables, which are related to each other, so modification to them needs to be an atomic operation. A reader-writer system can be of the following types: rr ww r-w r-ww rr-w rr-ww where [ r : single reader rr:...

Ordering in ReaderWriterLock

When I use lock(){...}, I cannot garantee which thread will enter the lock first. What about ReaderWriterLock? Does it works like a FIFO for the writers or not? ...

Cross-process read-write synchronization primative in .NET?

Is there a read/write locking mechanism that works across processes (similar to Mutex, but read/write instead exclusive locking)? I would like to allow concurrent read access, but exclusive write access. ...