views:

33

answers:

1

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?

+1  A: 
Richard
So ReaderWriterLock does the FIFO, but ReaderWriterLockSlim does not!?
Marcus
Correct. the `RaaderWriterLock` documentation covers the details (when a writer leaves all pending readers get in, when they have all completed then the longest waiting writer gets in, ...).
Richard