Synchronization & Concurrency



Answer & solution
Answer: Yes. Waiting writers do not prevent new readers from entering. (no official key was published)
Consider two streams of readers whose reading intervals overlap. Before the last current reader exits, a new reader acquires mutex, observes W=0, increments R and begins reading. Arrange this repeatedly so R never becomes 0. A waiting writer may acquire mutex infinitely often, but each time it finds R>0, releases mutex and retries. It therefore never reaches W=1, even though every individual read finishes. A pending writer is not recorded anywhere: W means an active writer, not a waiting writer. Consequently new readers remain admissible throughout this schedule. This is starvation, not deadlock, since readers keep making progress. Even fairness in acquiring the bookkeeping semaphore would not repair this example because the writer gets turns and still cannot enter. Avoiding it requires a different admission policy, for example recording waiting writers and refusing new readers while a writer waits, together with suitable queue fairness; that change is outside the requested three boxes.