HI,
-- Within a SINGLE call of LockAcquire, is it possible for GrantLock() to be 
called multiple times?



Thanks
-SUmaira





_________________________________________________________________
The new MSN 8: smart spam protection and 2 months FREE*  
http://join.msn.com/?page=features/junkmail


Thu, 24 Apr 2003 01:05:18 -0700
"S -" <nat_lazy@hotmail.com>
src/backend/storage/lmgr/lock.c ----> LockAcquire()
"S -" <nat_lazy@hotmail.com> writes:
> -- Within a SINGLE call of LockAcquire, is it possible for GrantLock() to be 
> called multiple times?

Hmm.  In the normal course of events, a LockAcquire would only try to
grant the target lock to itself; it couldn't grant anything to anyone
else as a byproduct.  But I think there might be corner cases involving
deadlock detection.  Once a deadlock is detected, the resulting
transaction abort leads to lock releases which lead to lock grants
occurring --- so how narrowly are you defining "a single call of
LockAcquire"?

In any case a single call of LockRelease can certainly result in
multiple GrantLocks, so I'm not sure what sort of optimization you might
have in mind that would be feasible.

			regards, tom lane


Thu, 24 Apr 2003 09:09:57 -0400
Tom Lane <tgl@sss.pgh.pa.us>
Re: src/backend/storage/lmgr/lock.c ----> LockAcquire() 