Skip site navigation (1) Skip section navigation (2)

Locks and Waiters

From: "kenneth d'souza" <kd_souza(at)hotmail(dot)com>
To: pgsql-docs(at)postgresql(dot)org
Subject: Locks and Waiters
Date: 2007-07-09 08:47:19
Message-ID: BAY116-F256006D270E22F9D1062E0ED060@phx.gbl (view raw or flat)
Thread:
Lists: pgsql-docs
<html><div style='background-color:'><DIV class=RTE>I have question on Locks and waiting. </DIV>
<P>In the readme pgsql/src/backend/storage/lmgr/README </P>
<P>&nbsp;</P>
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>Each waiter is awoken if (a) its request
<DIV></DIV>does not conflict with already-granted locks, and (b) its request does
<DIV></DIV>not conflict with the requests of prior un-wakable waiters.
<DIV></DIV>
<DIV></DIV>Let us imagine if there is Process P which is holding a lock and there are individual waiters p1 p2 p3 p4 p5 p6 requiring the same lock. Now since they are in conflict it is sure that there will be wait queue that will get generated as in p1 p2 p3 p4 p5 p6.
<DIV></DIV>Image if Process P releases it lock. As per explaination given in (a) it is sure that p1 will wake up. What is the status of p2. It was in conflict with process P and hence should we term it that it will not wake up. Same is the case with p2 ... p6.
<DIV></DIV>Under what circumstance will p2 be also woken up taking into consideration that the lock held by process P is released.
<DIV></DIV>Secondly if p2 is not woken up and if p3's lock doesn't conflict with P and p2 then by rule(b) will p3 move ahead&nbsp;&nbsp;of p2
<DIV></DIV>
<DIV></DIV>Thanks,
<DIV></DIV>Kenneth
<DIV></DIV>
<DIV></DIV></div><br clear=all><hr>Tried the new MSN Messenger? Its cool! <a href="http://g.msn.com/8HMBENIN/2749??PS=47575" target="_top">Download now.</a> </html>



Attachment: unknown_filename
Description: text/html (1.4 KB)

pgsql-docs by date

Next:From: Jim NasbyDate: 2007-07-11 17:49:44
Subject: Re: [DOCS] Users comments don't migrate to docs for new version?
Previous:From: Neil ConwayDate: 2007-07-03 23:32:59
Subject: Re: [DOCS] rename of a view

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group