Shared var between processes

Ben RUBSON <[email protected]>
Newsgroups gmane.comp.apache.mod-perl
Message-ID <[email protected]>
Hi,

I'm trying to share a var between the different processes of my prefork  
Apache.

I then tried the following idea :
$r->server()->dir_config('var','val');
Unfortunately, $r->server()->dir_config('var') is not shared among the  
processes.
I would have thought config was stored at the very first Apache process  
(the parent) level.

Other solution is IPC::Shareable (one more module to load :-/)

Any other solution ?
I would have been happy with an Apache-only way to do this (like I tried  
above).

I need the var to be set only one time to a constant random value, then to  
be read by the different processes.
I then also thought about an environment variable set when Apache starts,  
and then given to Perl using "PerlSetVar var ${VAR}".
But 1. var value would be disclosed into Apache env which I want to avoid,  
2. PerlSetVar at every request is perhaps not really perfect in terms of  
performance.

Thank you very much for your help !

Ben
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.