Computer Systems: a Programmer’s Perspective says
The readers-writers problem has several variations, each based on the
priori- ties of readers and writers.
The ﬁrst readers-writers problem, which favors readers, requires that no reader be kept waiting unless a writer has already been
granted permission to use the object. In other words, no reader should
wait simply because a writer is waiting.
The second readers-writers problem, which favors writers, requires that once a writer is ready to write, it performs its write as soon as
possible. Unlike the ﬁrst problem, a reader that arrives after a
writer must wait, even if the writer is also waiting.
the first problem: no reader shall be kept waiting if the share is currently opened for reading. It prefers readers over writers, may starve writers in the queue
the second problem: no writer, once waiting i.e. added to the queue, shall be kept waiting longer than necessary. It prefers writers over readers, may starve readers.
Is it correct that:
Regardless of which type of reader-writer problem, if there is reader(s) in critical region, a waiting reader can always enter the critical region, and a waiting writer can’t, regardless of which one arrives earlier?
Regardless of which type of reader-writer problem, if a writer is in critical region, no waiting reader or writer can enter the critical region, regardless of which one arrives earlier?
Is the first problem defined as: if no reader/writer is in critical region, a waiting reader shall have priority over a waiting writer, independently of which arrived earlier?
Is the second problem defined as: if no reader/writer is in critical region, a waiting writer has priority over a waiting reader, independently of which arrived earlier?