Re: and waiting - Mailing list pgsql-hackers

From Gurjeet Singh
Subject Re: and waiting
Date
Msg-id 65937bea0802021533o4bcc3483pfdf4882e6b52a58e@mail.gmail.com
Whole thread Raw
In response to Re: and waiting  (Alvaro Herrera <alvherre@commandprompt.com>)
List pgsql-hackers
On Feb 2, 2008 3:27 PM, Alvaro Herrera <alvherre@commandprompt.com> wrote:
Gurjeet Singh escribió:

> I just looked at the patch... Isn't PG_TRY() an expensive call to make in
> the lock.c code? I was thinking of registering a Xact callback using
> RegisterXactCallback() and performing 'waiting' reset in that callback if
> the Xact event is XACT_EVENT_ABORT.

PG_TRY is not expensive as all that -- it's just a sigsetjmp() call and
another stack frame.


Thats why I asked. I assumed that creating stacks was expensive. Isn't this the reason the compilers came up with the function inline capability; to avoid stacks, because they can be expensive. Or am I confusing two different types of stacks!

Moreover, calling a callback, once in a while (only upon XACT abort), may prove to be much cheaper than setting up an additional stack on every lock-acquire call.

Really, my 2 cents.

--
gurjeet[.singh]@EnterpriseDB.com
singh.gurjeet@{ gmail | hotmail | indiatimes | yahoo }.com

EnterpriseDB      http://www.enterprisedb.com

17° 29' 34.37"N,   78° 30' 59.76"E - Hyderabad
18° 32' 57.25"N,   73° 56' 25.42"E - Pune
37° 47' 19.72"N, 122° 24' 1.69" W - San Francisco *

http://gurjeet.frihost.net

Mail sent from my BlackLaptop device

pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: and waiting
Next
From: Tom Lane
Date:
Subject: Re: and waiting