Re: dynamic loading of .so

From: Marc Munro <marc(at)bloodnok(dot)com>
To: cristian(at)clickdiario(dot)com, pgsql-general(at)postgresql(dot)org
Cc: tjo(at)acm(dot)org, doug(at)mcnaught(dot)org
Subject: Re: dynamic loading of .so
Date: 2005-10-17 15:34:46
Message-ID: 1129563286.13930.10.camel@bloodnok.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

If you need user-accessible shared variables, you could take a look at
how Veil http://pgfoundry.org/projects/veil/ achieves this.

Veil provides a limited number of shared variables with an API for SQL
access. The variables may only be set during initialisation or reset to
avoid system state changing part-way through a transaction. Veil goes
to considerable trouble to deal with this. If this is not a concern for
you, you may be able to do something simpler but you would have to
perform extra locking on assignment.

Feel free to take whatever you can from Veil.

__
Marc

> Date: Sun, 16 Oct 2005 18:54:21 -0500 (CDT)
> From: <cristian(at)clickdiario(dot)com>
> To: doug(at)mcnaught(dot)org, tjo(at)acm(dot)org
> Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
> Subject: Re: dynamic loading of .so
> Message-ID: <ozXzqVpq(dot)1129506861(dot)7416760(dot)cristian(at)clickdiario(dot)com>
>
>
> are there any way to make them global for all the instances?
>
> On 10/14/2005, "Douglas McNaught" <doug(at)mcnaught(dot)org> wrote:
>
> >TJ O'Donnell <tjo(at)acm(dot)org> writes:
> >
> >> I have begun to use some static variables in my c-language
> >> functions to maintain state (3rd party licensing issues) during
> >> the course of a session (postgres process, spawned by postmaster).
> >> These are declared static outside the scope of any function.
> >> (is global the correct term anymore?)
> >> When I use dynamic loading of my .so,
> >> each session is independent, with its own static variables.
> >> Will the same be true if I were to load the .so once when
> >> the database starts up? Or will there be just one set of
> >> static variables for all sessions?
> >
> >Each backend process has its own memory space, so the variables will
> >still be independent.
> >
> >-Doug

Browse pgsql-general by date

  From Date Subject
Next Message Dean Gibson (DB Administrator) 2005-10-17 16:35:34 Planner regression in 8.0.x ?
Previous Message Florian Ledoux 2005-10-17 15:33:07 autovacuum deamon on 8.0.3 - WinXP