Process Synchronization with Readers and Writers Revisited
Other literature type
- Publisher: SRCE - University Computing Centre
Journal of computing and information technology,
(issn: 1330-1136, eissn: 1846-3908)
The readers-writers problem is one of the very well known problems in concurrency theory. It was first introduced by Courtois et.al. in 1971  and requires the synchronization of processes trying to read and write a shared resource. Several readers are allowed to access the resource simultaneously, but a writer must be given exclusive access to that resource. Courtois et.al. gave semaphore-based solutions to what they called the first and second readers-writers problems. Both of their solutions are prone to starvation. The first allows readers to indefinitely lock out writers and the second allows writers to indefinitely lock out readers. This paper presents and proves correct a third semaphore-based solution, which is starvation-free for both reader and writer processes. To the best of our knowledge, this is the first fair semaphore-based solution that at the same time allows several readers to access the resource simultaneously.