timcassell / ProtoPromise

Robust and efficient library for management of asynchronous operations in C#/.Net.
MIT License
180 stars 13 forks source link

Add `AsyncReaderWriterLock` #192

Closed timcassell closed 1 year ago

timcassell commented 1 year ago

163

This is a balanced reader/writer lock. This means readers and writers "take turns" if there is contention on the lock, so no one will get starved out. This is in contrast to System.Threading.ReaderWriterLockSlim that prefers writers, so if there are many writers trying to take the lock, they can starve out readers.