[Bizgres-general] Transactional Statement Queuing - Queue Design 1

Mark Kirkwood markir at paradise.net.nz
Thu May 4 23:55:35 UTC 2006


Jim C. Nasby wrote:
> On Thu, May 04, 2006 at 02:29:16PM +1200, Mark Kirkwood wrote:
>> While there are only two lock modes defined :'exclusive' and 'shared' 
>> (see src/include/storage/lwlock.h), it is fairly straightforward to either:
>>
>> - add another lock mode (say 'share-limited' or just 'limited') that
>>    works like 'shared' but with a limit to the number of holders (or)
>> - amend the 'shared' section of code to:
>>     -> see if there is a limit associated with the particular lightweight
>>        lock
>>     -> set the mustwait flag if the number of shared holder is = the
>>        limit.
> 
> Maybe I missed this somewhere, but how will you ensure some kind of
> order on which backend gets to take the next lock when one becomes
> available? Or is there alread code in the locking mechanisms that
> provides for this?

Yes - there is a queue object for the lightweight lock.

Cheers

Mark


More information about the Bizgres-general mailing list