Read Write Lock

Intent: Allow concurrent read access to an object but require exclusive access for write operations.

See also LockPattern, SchedulerPattern, BalkingPattern


Programs that have very high ReadToWriteRatio or that have read-side critical sections with very large runtimes compared to synchronization OverHead can benefit from specialized synchronization primitives that allow several readers to occupy a given critical section concurrently, but allow only one writer to do so, and cause that writer to exclude all readers.


It is possible for any number of readers to read the "previous version" of a data structure, while simultaneously, any number of writers are updating the data structure. But this gets complicated and tricky in a hurry. See WaitFreeSynchronization.

"DoubleBuffering" allows any number of readers to read the "previous version" of a data structure, while simultaneously, one writer is working on updating the "current version".


From SynchronizationStrategies. See also: WriteYourOwnThreadingPackage


CategoryPattern CategoryConcurrencyPatterns


EditText of this page (last edited January 15, 2006) or FindPage with title or text search