Thread: Putting code in main of src/backend/main/main.c
HI, We are working on a project where we want to create a single linked list that holds information of all the locks taken or being waited for by transactions in Postgresql. Since main in src/backend/main/main.c will be run just once when the Postgresql starts up, can declaration and initialization of this single linked list be put in this main? Thank you Sumaira _________________________________________________________________ Protect your PC - get McAfee.com VirusScan Online http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
"S -" <nat_lazy@hotmail.com> writes: > We are working on a project where we want to create a single linked list > that holds information of all the locks taken or being waited for by > transactions in Postgresql. How will you maintain such a list, when the underlying state is constantly being changed by many different processes? Perhaps more to the point, why would you want to? The existing lock status data structures in shared memory can be traversed at need. regards, tom lane
<div style="background-color:"><div><div></div>>"S -" writes: </div><div></div>> > We are working on a project wherewe want to create a single linked list <div></div>> > that holds information of all the locks taken or being waitedfor by <div></div>> > transactions in Postgresql. <div></div>> <div></div>>How will you maintain such alist, when the underlying state is <div></div><p>>constantly being changed by many different processes? <p>What do youmean by underlying state? And also, each each time any process (transaction)wants to acqure a lock it calls LockAcquire(and if we put our code to update our linkedlist)and won't that ways each processes's actions be recorded in thelinkedlist.<p>thanks<p>-sumaira<div></div><div></div></div><br clear="all" /><hr />The new <a href="http://g.msn.com/8HMAENUS/2737">MSN8:</a> smart spam protection and 2 months FREE*
"Sumaira Ali -" <nat_lazy@hotmail.com> writes: > <P>What do you mean by underlying state? And also, each each time any process (transaction)wants to acqure a lock it callsLockAcquire (and if we put our code to update our linkedlist)and won't that ways each processes's actions be recordedin the linkedlist.</P> Not unless you keep the linked list in shared memory --- at which point it is surely duplicative of the lists the lock manager already maintains. regards, tom lane
<div style="background-color:"><div><p><br /><br /></div><div></div><div></div>>From: Tom Lane <div></div>>To: "SumairaAli -" <div></div>>CC: pgsql-hackers@postgresql.org <div></div>>Subject: Re: [HACKERS] Putting code in mainof src/backend/main/main.c <div></div>>Date: Fri, 25 Apr 2003 00:28:19 -0400 <div></div>> <div></div>>"SumairaAli -" writes: <div></div>> > <p>What do you mean by underlying state? And also, each each timeany process (transaction)wants to acqure a lock it calls LockAcquire (and if we put our code to update our linkedlist)andwon't that ways each processes's actions be recorded in the linkedlist.<div></div>> <div></div>>Not unlessyou keep the linked list in shared memory --- at which point <div></div>>it is surely duplicative of the lists thelock manager already maintains. <div></div>> <div></div>> regards, tom lane <div>Is LockData the data structureof Lock.h and <font size="2">GetLockStatusData(</font><font color="#0000ff" size="2">void</font><font size="2">)the funciton that returns the all hte information relating to locks (being waited for and taken up by differnttransactions) in postgresql?</font></div><div><font size="2">thanks</font></div><div><font size="2">sumaira</font></div></div><brclear="all" /><hr />Add photos to your e-mail with <a href="http://g.msn.com/8HMVENUS/2746">MSN8.</a> Get 2 months FREE*.