Re: lwlocks and starvation - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: lwlocks and starvation
Date
Msg-id 200411241234.iAOCYR104015@candle.pha.pa.us
Whole thread Raw
In response to Re: lwlocks and starvation  (Neil Conway <neilc@samurai.com>)
Responses Re: lwlocks and starvation  (Neil Conway <neilc@samurai.com>)
List 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@candle.pha.pa.us               |  (610)
359-1001+  If your life is a hard drive,     |  13 Roberts Road +  Christ can be your backup.        |  Newtown Square,
Pennsylvania19073
 


pgsql-hackers by date:

Previous
From: Neil Conway
Date:
Subject: Re: lwlocks and starvation
Next
From: Neil Conway
Date:
Subject: Re: lwlocks and starvation