Locks and Waiters
От | kenneth d'souza |
---|---|
Тема | Locks and Waiters |
Дата | |
Msg-id | BAY116-F256006D270E22F9D1062E0ED060@phx.gbl обсуждение исходный текст |
Список | pgsql-docs |
<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> <div></div><div></div><div></div>Each waiter is awoken if (a) its request <div></div>doesnot conflict with already-granted locks, and (b) its request does <div></div>not conflict with the requestsof prior un-wakable waiters. <div></div><div></div>Let us imagine if there is Process P which is holding a lock andthere are individual waiters p1 p2 p3 p4 p5 p6 requiring the same lock. Now since they are in conflict it is sure thatthere 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 withprocess P and hence should we term it that it will not wake up. Same is the case with p2 ... p6. <div></div>Under whatcircumstance will p2 be also woken up taking into consideration that the lock held by process P is released. <div></div>Secondlyif 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 ofp2 <div></div><div></div>Thanks, <div></div>Kenneth <div></div><div></div></div><br clear="all" /><hr />Tried thenew MSN Messenger? It�s cool! <a href="http://g.msn.com/8HMBENIN/2749??PS=47575" target="_top">Download now.</a>
В списке pgsql-docs по дате отправления: