Re: lwlocks and starvation

Поиск
Список
Период
Сортировка
От Neil Conway
Тема Re: lwlocks and starvation
Дата
Msg-id 41A47C0F.5030000@samurai.com
обсуждение исходный текст
Ответ на Re: lwlocks and starvation  (Bruce Momjian <pgman@candle.pha.pa.us>)
Ответы Re: lwlocks and starvation  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-hackers
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.

> There should be a comment in the code explaining this usage and I bet it
> was intentional.

Oh, I bet it was intentional as well :) I'm mostly curious to see 
exactly what the reasoning was, and whether it is necessary that we 
preserve the FIFO behavior while considering optimizations.

-Neil


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: lwlocks and starvation
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: lwlocks and starvation