Re: [PATCH] lock_timeout and common SIGALRM framework

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: [PATCH] lock_timeout and common SIGALRM framework
Дата
Msg-id CA+TgmoYTTFTnJBrfivECOFif2E8CpfX7k0izKrHC=OwmjPPa6g@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [PATCH] lock_timeout and common SIGALRM framework  (Boszormenyi Zoltan <zb@cybertec.at>)
Ответы Re: [PATCH] lock_timeout and common SIGALRM framework  (Boszormenyi Zoltan <zb@cybertec.at>)
Список pgsql-hackers
On Tue, Jun 26, 2012 at 3:59 AM, Boszormenyi Zoltan <zb@cybertec.at> wrote:
> Well, I can make the registration interface similar to how LWLocks
> are treated, but that doesn't avoid modification of the base_timeouts
> array in case a new internal use case arises. Say:
>
> #define USER_TIMEOUTS    4
>
> int    n_timeouts = TIMEOUT_MAX;
> static timeout_params base_timeouts[TIMEOUT_MAX + USER_TIMEOUTS];

Since timeouts - unlike lwlocks - do not need to touch shared memory,
there's no need for a hard-coded limit here.  You can just allocate
the array using MemoryContextAlloc(TopMemoryContext, ...) and enlarge
it as necessary.  To avoid needing to modify the base_timeouts array,
you can just have internal callers push their entries into the array
during process startup using the same function call that an external
module would use.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: Backport of fsync queue compaction
Следующее
От: Andres Freund
Дата:
Сообщение: Re: Catalog/Metadata consistency during changeset extraction from wal