Unix Technical Forum

New shared memory hooks proposal (was Re: pre_load_libraries)

This is a discussion on New shared memory hooks proposal (was Re: pre_load_libraries) within the pgsql Hackers forums, part of the PostgreSQL category; --> On Thu, 2006-07-13 at 01:13 -0300, Tom Lane wrote: > Marc Munro <marc@bloodnok.com> writes: > > ... A better ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Hackers

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-12-2008, 03:24 AM
Marc Munro
 
Posts: n/a
Default New shared memory hooks proposal (was Re: pre_load_libraries)

On Thu, 2006-07-13 at 01:13 -0300, Tom Lane wrote:
> Marc Munro <marc@bloodnok.com> writes:
> > ... A better solution from my point of view would be
> > to simply move the call to process_preload_libraries to a point

> after
> > shared memory has been set up. Is there some reason this could not

> be
> > done?

>
> That would make it impossible for a preloaded library to request any
> shared memory of its own --- something that admittedly we don't have a
> hook to support, but do we want to foreclose it permanently?


That does sound like the right way to go. Here is my new proposal:

Add-ins register their requirement for shared memory using a new
function: RegisterShmemRequirement(char *context_name, int size). This
would be called by the init function called from
process_preload_libraries.

When shared memory is initialised, extra space is allocated for each
registered add-in. Each add-in's registered allocation is a separate
memory context identified by the context_name parameter provided during
registration.

Add-ins allocate shared memory from their own context using a new
function ShemAddinAlloc(), which adds the context_name parameter to the
normal ShemAlloc parameter list.

This would save add-ins from having to manage their own shared memory
segements while providing a degree of separation and isolation so that
one add-in could not exhaust the shared memory of another or of the
backend.

If this is acceptable, I think it is within my skill level to implement.
Comments?

__
Marc

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)

iD8DBQBEtmlsUBr6u+c2wkERAgTmAJwMETezhc+wh9+h99Euf+ CJM8vATACeNLlD
W8ohMlsQFanhyqfY4q5269c=
=Vru4
-----END PGP SIGNATURE-----

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 05:36 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com