Reader-Writer Locks
Explore reader-writer locks to manage concurrent access in operating systems. Understand how these locks allow multiple readers simultaneous access while writers require exclusive access. Learn the implementation basics using semaphores, the potential for writer starvation, and considerations for choosing simpler locking methods.
We'll cover the following...
Another classic problem stems from the desire for a more flexible locking primitive that admits that different data structure accesses might require different kinds of locking. For example, imagine a number of concurrent list operations, including inserts and simple lookups. While inserts change the state of the list (and thus a traditional critical section makes sense), lookups simply read the data structure; as long as we can guarantee that no insert is on-going, we can allow many lookups to proceed concurrently. The special type of lock we will now develop to support this type of operation is known as a ...