Joe Schaefer wrote:
[...]

Thanks Stas for the clear explanation.  Although I don't fully
understand how the interpreter pools operate yet,

Feel free to ask additional questions, Joe. I have explained that several times on the modperl list, but never had a chance to throughly document that. One day...


I'm still of the opinion that the best way to resolve this problem is to ensure the same interpreter always runs whatever extra hooks it creates (eg pool cleanups, filters/handlers added, etc.).

That will be only possible if you drop the pools functionality, the interpreter scopes, etc.


I was thinking that something is flawed in my explanation, but no, I've checked mp1 source and in mod_perl.c it has:

#if 0 /* XXX: CV lookup cache disabled for now */
        if(!is_method && defined_sub) { /* cache it */
            MP_TRACE_h(fprintf(stderr,
                             "perl_call: caching CV pointer to `%s'\n",
                             (anon ? "__ANON__" : SvPV(sv,na))));
            SvREFCNT_dec(sv);
            sv = (SV*)newRV((SV*)cv); /* let newRV inc the refcnt */
        }
#endif

so I suppose caching of anon CVs compiled at run-time never worked.

Now, let's say we could somehow store those CVs in each interpreter,
rather than mod_perl's handlers (which I can't see how is it possible
w/o turning anon subs into named, which may have some bad
side-effects. We still have problems:


if we have:

  PerlInterpScope handler

http://perl.apache.org/docs/2.0/user/config/config.html#C_PerlInterpScope_

it's possible that the module was compiled during PerlTranshandler, by
interpreter A, but interpreter B was selected to run
PerlResponseHandler (which is the anon sub). What do we do now? B has
no idea what that anon-sub is, as it didn't compile it.


Is it really ok for interpreter B to deparse A's sub here?

It doesn't do that. A deparses the function and stores its source in the mod_perl struct. Then B compiles it before running it.



-- __________________________________________________________________ Stas Bekman JAm_pH ------> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to