Re: lwlocks and starvation

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Neil Conway <neilc(at)samurai(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: lwlocks and starvation
Date: 2004-11-24 12:34:26
Message-ID: 200411241234.iAOCYR104015@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Neil Conway wrote:
> Bruce Momjian wrote:
> > My guess is the existing behavior was designed to allow waking of
> > multiple waiters _sometimes_ without starving of exclusive waiters.
>
> Well, I think the current algorithm *does* allow starvation, at least in
> some situations. Consider a workload in which a new shared reader
> arrives every 50 ms, and holds the lock for, say, 500 ms. If an
> exclusive waiter arrives, they will starve with the current algorithm.

I thought the new readers will sit after the writer in the FIFO queue so
the writer will not starve.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Neil Conway 2004-11-24 12:52:11 Re: lwlocks and starvation
Previous Message Neil Conway 2004-11-24 12:18:23 Re: lwlocks and starvation