[mod_python] persistent, reliable globals

Bert Hughes bert at tela.com
Mon Mar 8 00:45:47 EST 2004


Apache starts number of child process - any given web connection could be
served by any of these, or apache root may start a new child to answer http
request.  Refreshing same page from same client could result in service from
different apache child processes.  Mod_python and your modules live in each
child independently - setting global only sets in it one apache process, not
other or future processes.

At least that's my understanding.

Bert Hughes

----- Original Message ----- 
From: "David Geller" <dg at sponsera.com>
To: <mod_python at modpython.org>
Sent: Sunday, March 07, 2004 11:21 PM
Subject: [mod_python] persistent, reliable globals


> Hi,
>
> I would like to set a global variable (in memory) from a module. I would
> then like to access this same global variable susequently by other
> modules at any other time, and have the value that was set there to be
> there (until, of course, Apache is restarted).
>
> I have tried several ways of doing this, and it doesn't seem to be
> reliable - i.e., sometimes the global variable is set when I look at it,
> and sometimes it is still at its original state.
>
> What am I doing wrong (or right)?
>
> Thanks!
>
>
>
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://mailman.modpython.org/mailman/listinfo/mod_python
>
>




More information about the Mod_python mailing list