Putting code in main of src/backend/main/main.c
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
Re: Putting code in main of src/backend/main/main.c
"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? 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
Re: Putting code in main of src/backend/main/main.c
>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*
Re: Putting code in main of src/backend/main/main.c
"Sumaira Ali -" writes: >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 lane
Re: Putting code in main of src/backend/main/main.c
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 laneAdd photos to your e-mail with MSN 8. Get 2 months FREE*.