Re: [HACKERS] New locking code

ocie@paracel.com

From: ocie@paracel.com
To: maillist@candle.pha.pa.us (Bruce Momjian)
Cc: hackers@postgreSQL.org
Date: 1998-02-18T20:31:15Z
Lists: pgsql-hackers
Bruce Momjian wrote:

[snip]
> What do people think of this patch?  Is his way better, to always put
> the readers at the front if the current lock holder is a writer?

This way seems to make sense to me because it provides two guarantees:

1) Neither readers or writers can ever be starved when trying toa
access an object.

2) The system implements a FIFO queue.  I.E. A reader can't "cut in
line" in front of a waiting writer just because the current access
mode is shared.  The operations that have been waiting the longest get
serviced first.

Ocie Mitchell