Elizabeth Mattijsen wrote:

If you are talking about serving HTTP, you probably want PerlInitHandler. Similar to Apache::Reload.

But PerlInitHandler runs in the child, does it not?

They all run in the child. The only hooks run by the parent process that spawns the child processes is PostConfig and OpenLogs, which happen at the server startup.


Ok, so much for that idea then... if there is no handler running in the parent for each request, then my idea won't fly... unless I do all of this in a signal handler in the parent...would that fly? Something like this in PerlRequire:

my $updating;
$SIG{123} = sub {
    return if $updating++;  # make sure only one at a time
    #update data structures;
    $updating = 0;
};

That's what you told me back in July, which I liked. Though I haven't seen it at work yet.


But if you do that already, why not just hup the server right away and let it reread the cached data that some child has updated. So you could have the readonly cache preloaded at the server startup, initialized from the writable cache which can be updated by an external process or an httpd child, but which won't affect the read-only copy. I think Apache::DB_File is just what you are after.

I don't think there is any other way to make parent do something. Remember that all it does is sitting in a tight loop and watching after the number of available child processes and spawns new ones/kills old ones.


__________________________________________________________________ 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


-- Reporting bugs: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html



Reply via email to