You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by Stas Bekman <st...@stason.org> on 2001/07/06 19:02:31 UTC

PerlModule implementation (fwd)

I've been trying to implement the PerlModule directive, not much lack so
far since I miss a basic understanding of many design concepts and
learning my way around.

I understand that no actual processing happens before the config merge
stage. Is that correct? I've tried to call the modperl_require_module()
from modperl_cmd.c but I've learned that 'scfg' doesn't have 'mip' member
yet. I thought may be I should init the interpreter and get hold on
base_scfg, but then I've seen that PerlSwitches merely pushes its args
into scfg->argv. What I don't understand is how the stored PerlSwitches
args later will be identified in scfg->argv and fed into interpreter. Can
you please give me a hint to find the place where the activation of the
PerlSwitches happens inside the interpreter?

So basically I've to store PerlModule args somewhere in scfg->argv, then
somewhere later (when?) I grab those and run modperl_require_module when I
have the interpreter. Is that correct?

Another question is about a definition of how do we want PerlModule to
work:

- load modules in the parent interpreter and let all children inherit from
  it.
- allow each vhost to have its own preloaded modules.
- allow each interpteter pool have its own preloaded modules (which is
  probably the same as the prev item, right?)

>From one side sharing all the preloaded modules is a great benefit because
of the shared optree, on the other hand if these modules have some big
data structures in them at the init time, this data will be inhereted by
all tipools. Now when this data gets dirty, copy-on-write happens and now
we have a memory chunk, not used by anyone, wasted.

May be we need to have normal PerlModule, which loads into the base
interpretor and have a second directive PerlLocalModule which allows to
load the module only in the parent of the tipool?

Thanks a lot!

_____________________________________________________________________
Stas Bekman              JAm_pH     --   Just Another mod_perl Hacker
http://stason.org/       mod_perl Guide  http://perl.apache.org/guide
mailto:stas@stason.org   http://apachetoday.com http://eXtropia.com/
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/




---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org