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 2004/03/01 21:06:06 UTC
[mp2] ptemp usage
I've looked at the httpd source code, ptemp is destroyed at the end of the
post_config phase. So we should use it for any temporary things that don't
need to live through the config.
So hook-config is the perfect case for ptemp. We need to review other places
where we should use ptemp instead. I'll update the docs.
__________________________________________________________________
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://ticketmaster.com
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org
Re: [mp2] ptemp usage
Posted by "Philippe M. Chiasson" <go...@cpan.org>.
On Mon, 2004-03-01 at 12:36 -0800, Stas Bekman wrote:
> Geoffrey Young wrote:
> >
> > Stas Bekman wrote:
> >
> >>I've looked at the httpd source code, ptemp is destroyed at the end of
> >>the post_config phase. So we should use it for any temporary things that
> >>don't need to live through the config.
> >>
> >>So hook-config is the perfect case for ptemp.
> >
> >
> > that's fine, but how do you get to it? for instance, we can create the
> > hook_order table using ptemp by calling the init in pre-config. however,
> > there is no easy way to get to ptemp from modperl_cmd, where the data going
> > into hook_order will be generated - all you have is pconf or parms->pool at
> > that point.
> >
> > or are you planning on adding a set of hooks to get to ptemp?
>
> I think we need a hook to access it. Have a static global, init it from
> pre_config and use it when needed.
That sounds good. Then we just need to sweep around and find the places
where we should use it instead of a more global pool.
> Here is a short summary of pool life-times:
>
> C<$log_pool> is a global pool's sub-pool, therefore its life-span is
> the same as the Apache program's one.
>
> C<$conf_pool> is the main process sub-pool, therefore its life-span
> is the same as the main process's one. The main process is a sub-pool
> of the global pool.
>
> C<$temp_pool> is a C<$conf_pool> subpool, created before the config
> phase, lives through the open_logs phase and get destroyed after the
> post_config phase.
>
> The ancestry tree:
>
> global
> | |
> main_process log
> |
> conf
> |
> temp
>
> __________________________________________________________________
> Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
> http://stason.org/ mod_perl Guide ---> http://perl.apache.org
> mailto:stas@stason.org http://use.perl.org http://apacheweek.com
> http://modperlbook.org http://apache.org http://ticketmaster.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
> For additional commands, e-mail: dev-help@perl.apache.org
>
Re: [mp2] ptemp usage
Posted by Stas Bekman <st...@stason.org>.
Geoffrey Young wrote:
>
> Stas Bekman wrote:
>
>>I've looked at the httpd source code, ptemp is destroyed at the end of
>>the post_config phase. So we should use it for any temporary things that
>>don't need to live through the config.
>>
>>So hook-config is the perfect case for ptemp.
>
>
> that's fine, but how do you get to it? for instance, we can create the
> hook_order table using ptemp by calling the init in pre-config. however,
> there is no easy way to get to ptemp from modperl_cmd, where the data going
> into hook_order will be generated - all you have is pconf or parms->pool at
> that point.
>
> or are you planning on adding a set of hooks to get to ptemp?
I think we need a hook to access it. Have a static global, init it from
pre_config and use it when needed.
Here is a short summary of pool life-times:
C<$log_pool> is a global pool's sub-pool, therefore its life-span is
the same as the Apache program's one.
C<$conf_pool> is the main process sub-pool, therefore its life-span
is the same as the main process's one. The main process is a sub-pool
of the global pool.
C<$temp_pool> is a C<$conf_pool> subpool, created before the config
phase, lives through the open_logs phase and get destroyed after the
post_config phase.
The ancestry tree:
global
| |
main_process log
|
conf
|
temp
__________________________________________________________________
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://ticketmaster.com
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org
Re: [mp2] ptemp usage
Posted by Geoffrey Young <ge...@modperlcookbook.org>.
Stas Bekman wrote:
> I've looked at the httpd source code, ptemp is destroyed at the end of
> the post_config phase. So we should use it for any temporary things that
> don't need to live through the config.
>
> So hook-config is the perfect case for ptemp.
that's fine, but how do you get to it? for instance, we can create the
hook_order table using ptemp by calling the init in pre-config. however,
there is no easy way to get to ptemp from modperl_cmd, where the data going
into hook_order will be generated - all you have is pconf or parms->pool at
that point.
or are you planning on adding a set of hooks to get to ptemp?
--Geoff
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org