Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Hackers > Attaching and u...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 2 Topic 9619 of 11009
Post > Topic >>

Attaching and using the Postgres shared memory segment

by Paul.Vandenbogaard@[EMAIL PROTECTED] (Paul van den Bogaard) Jul 3, 2008 at 12:01 PM

to look into an idea I currently have I need (and implemented)  a new  
piece of memory that resides in (Postgres) shared memory.  My data  
structures are in place an the new database seems running fine. Even  
under high load :-)

Since these data structures are for collecting information I was able  
to create a new function that retrieves its information from these  
data structures and returns them as a result from a query.

However this is too intrusive. Since everything is in shared memory it  
should be possible for an external, yet to be created, process to  
attach to the shared memory segment (read only mode only) to collect  
these data structures.

However, when I read the source I feel a little stuck. Kind of chicken  
and egg situation perhaps.

I have the address mapping of the shared memory (doing stuff on  
Solaris only). I can pass this information to InitShmemAccess (ipc/ 
shmem.c).  There is however a missing settting for ShmemIndex. This  
one can be initialsed by calling InitShmemIndex(). The only thing that  
makes me wonder is its need to use ShmemIndexLock. Although this is  
just an enum, and  therefore an index in some array created in  
CreateLWLock (lwlock.c).  I do not see how I can get access to this  
lock. Is it "just" there since obviously the whole Postgres shared  
memory is allocated, initialised and likely already heavily used.
Do the locks map to a "well know address" so I can do without further  
in process initialisation? Or is there another routine (or two ...)  
that I need to call in order to make things working.

Advise on how to proceed or pointers to docs in which this stuff is  
explained are highly appreciated.

Thanks
Paul.



---------------------------------------------------------------------------------------------
Paul van den Bogaard                              
Paul.vandenBogaard@[EMAIL PROTECTED]
  -- ISV Engineering, Opensource Engineering group

Sun Microsystems, Inc                              phone:        +31  
334 515 918
Saturnus 1                                                 extentsion:  
x (70)15918
3824 ME Amersfoort                                 mobile:       +31  
651 913 354
The Netherlands                                        fax:             
+31 334 515 001


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
 




 2 Posts in Topic:
Attaching and using the Postgres shared memory segment
Paul.Vandenbogaard@[EMAIL  2008-07-03 12:01:20 
Re: Attaching and using the Postgres shared memory segment
heikki@[EMAIL PROTECTED]   2008-07-03 14:33:01 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Dec 5 7:53:14 CST 2008.