On Feb 2, 2008 3:27 PM, Alvaro Herrera <[EMAIL PROTECTED]> 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. -- [EMAIL PROTECTED] [EMAIL PROTECTED] 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