Re: [PATCH] lock_timeout and common SIGALRM framework

From: Boszormenyi Zoltan <zb(at)cybertec(dot)at>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Marc Cousin <cousinmarc(at)gmail(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>, Hans-Juergen Schoenig <hs(at)cybertec(dot)at>, Ants Aasma <ants(at)cybertec(dot)at>
Subject: Re: [PATCH] lock_timeout and common SIGALRM framework
Date: 2012-06-26 12:03:01
Message-ID: 4FE9A4F5.7000407@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2012-06-26 13:50 keltezéssel, Robert Haas írta:
> On Tue, Jun 26, 2012 at 3:59 AM, Boszormenyi Zoltan <zb(at)cybertec(dot)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.

I know, but it doesn't feel right to "register" static functionality.

--
----------------------------------
Zoltán Böszörményi
Cybertec Schönig & Schönig GmbH
Gröhrmühlgasse 26
A-2700 Wiener Neustadt, Austria
Web: http://www.postgresql-support.de
http://www.postgresql.at/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Satoshi Nagayasu 2012-06-26 12:11:33 Re: pg_stat_lwlocks view - lwlocks statistics
Previous Message Andres Freund 2012-06-26 11:50:33 Re: Catalog/Metadata consistency during changeset extraction from wal