This is a discussion on Re: mod_perl2 and Apache::SharedMem - modperl ; On Nov 7, 2007, at 5:05 PM, Michael Peters wrote: > Boysenberry Payne wrote: >> If I created some of my static hashes and objects during the >> PerlPostConfigHandler phase >> and added them to either the configuration or log ...
On Nov 7, 2007, at 5:05 PM, Michael Peters wrote:
> Boysenberry Payne wrote:
>> If I created some of my static hashes and objects during the
>> PerlPostConfigHandler phase
>> and added them to either the configuration or log pools would that
>> me keep
>> some of my memory shared, assuming I could get at either pool
>> during the
> I think you're overthinking it here and getting yourself confused.
After being up for 36+ hours that's an understatement.
>> I have classes that create singleton objects with lots of static
>> Should I build these "constructs"
>> on server post config so they're already built in the child
>> processes as
>> shared memory rather than
>> building them in each child, increasing the non-shared memory use?
> This is how this is typically done:
> # in startup.pl
> use My::Constructs;
> # in My/Constructs.pm
> package My::Constructs;
> our @data = ();
> # do something to build out your data structure...
> Then in your application you can just access the data as
> @My::Constructs::data and it will be shared by all your child
> (assuming you don't modify it during a request).
Ah, passing constructs directly, I've been trying to figure out that
for a while.
Can I do that using strict, or do I have to delimit it around the
I remember getting errors when I tried that before.