PGRPROC

Started by Sumaira Alialmost 23 years ago2 messages
#1Sumaira Ali
nat_lazy@hotmail.com

<html><div style='background-color:'><DIV>if pgproc is used to represent a process and proclock represents a process and its locks of interest, then why does pgproc contain the following information about locks?</DIV>
<DIV><FONT color=#008000 size=2>
<P>/*</P>
<P>* XLOG location of first XLOG record written by this backend's</P>
<P>* current transaction. If backend is not in a transaction or hasn't</P>
<P>* yet modified anything, logRec.xrecoff is zero.</P>
<P>*/</P></FONT><FONT size=2>
<P>XLogRecPtr logRec;</P>
<P></FONT><FONT color=#008000 size=2>/* Info about LWLock the process is currently waiting for, if any. */</P></FONT><FONT size=2>
<P></FONT><FONT color=#0000ff size=2>bool</FONT><FONT size=2> lwWaiting; </FONT><FONT color=#008000 size=2>/* true if waiting for an LW lock */</P></FONT><FONT size=2>
<P></FONT><FONT color=#0000ff size=2>bool</FONT><FONT size=2> lwExclusive; </FONT><FONT color=#008000 size=2>/* true if waiting for exclusive access */</P></FONT><FONT size=2>
<P></FONT><FONT color=#0000ff size=2>struct</FONT><FONT size=2> PGPROC *lwWaitLink; </FONT><FONT color=#008000 size=2>/* next waiter for same LW lock */</P></FONT><FONT size=2>
<P></FONT><FONT color=#008000 size=2>/* Info about lock the process is currently waiting for, if any. */</P></FONT><FONT size=2>
<P></FONT><FONT color=#008000 size=2>/* waitLock and waitHolder are NULL if not currently waiting. */</P></FONT><FONT size=2>
<P>LOCK *waitLock; </FONT><FONT color=#008000 size=2>/* Lock object we're sleeping on ... */</P></FONT><FONT size=2>
<P>PROCLOCK *waitHolder; </FONT><FONT color=#008000 size=2>/* Per-holder info for awaited lock */</P></FONT><FONT size=2>
<P>LOCKMODE waitLockMode; </FONT><FONT color=#008000 size=2>/* type of lock we're waiting for */</P></FONT><FONT size=2>
<P>LOCKMASK heldLocks; </FONT><FONT color=#008000 size=2>/* bitmask for lock types already held on</P>
<P>* this lock object by this backend */</P></FONT><FONT size=2>
<P>SHM_QUEUE procHolders; </FONT><FONT color=#008000 size=2>/* list of PROCLOCK objects for locks held</P>
<P>* or awaited by this backend */</P></FONT><FONT size=2>
<P>};</P></FONT></DIV></div><br clear=all><hr>MSN 8 with <a href="http://g.msn.com/8HMWENUS/2740&quot;&gt;e-mail virus protection service: </a> 2 months FREE*</html>

#2Bruce Momjian
pgman@candle.pha.pa.us
In reply to: Sumaira Ali (#1)
Re: PGRPROC

The proclock is structure links locks and procs, either for locks held,
or procs waiting for locks.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073