Обсуждение: 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
>"S -" 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?
What do you mean 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 the linkedlist.
thanks
-sumaira
The new MSN 8: 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
What do you mean 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 the linkedlist.
> >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 laneIs LockData the data structure of Lock.h and GetLockStatusData(void) the funciton that returns the all hte information relating to locks (being waited for and taken up by differnt transactions) in postgresql?
thanks
sumaira
Add photos to your e-mail with MSN 8. Get 2 months FREE*.