What is ReaderWriter Locks?
You may want to lock the resource only whenever data is being written and permit multiple clients to parallel read data when data is not being updated. The ReaderWriterLock class forces exclusive access to a resource while a thread is modifying the resource, but it allows nonexclusive access when reading the resource. ReaderWriter locks are a very useful alternative to exclusive locks that cause other threads to wait, even when those threads don't need to update data.