the monitor hook gets only a pointer to an apr_pool_t structure.
________________________________ From: Some Guy <teknos...@gmail.com> To: modules-dev@httpd.apache.org Sent: Sat, April 17, 2010 4:24:18 PM Subject: Re: Process lifetime and hooks to use Thank you for your pointers. The monitor hook seems pretty useful and exactly what I want. From this example http://svn.apache.org/repos/asf/httpd/httpd/trunk/modules/examples/mod_example_hooks.c it seems the hook is passed a server_rec - is this the main server? If I have to for some reason port this to 2.0, will spawning the thread in post_config be my only option? How do things change when using Worker vs. Prefork MPMs in terms of declaring and using global vars? I need my module to work with either of these, so I will need to do some magic with the mpm_query. What is the relationship between number of configuration structures created (in the create config hook) and the number of child processes? Are configuration structures created once in a each child process (for each MPM)? If they are one to one, then it should be straightforward for what I would like to do as I would create the lock, thread (which now checks the mtime), and initial cache in the child_init and have them be vars in the config structure. In the request hook I could then grab the configuration structure and use the lock and cache. Is my understanding right? Thanks, SB On Sat, Apr 17, 2010 at 7:04 AM, Nick Kew <n...@apache.org> wrote: > > On 17 Apr 2010, at 11:33, alin vasile wrote: > > > I discovered that it is :) > > > > Any idea how would I retrieve in this hook the module config structure? > It seems it is not possible, as the only argument in the handler is a > apr_pool_t structure. > > It's in the parent process, which is single-threaded. So the usual module > rules > go out of the window, and you can use global/static vars in a monitor hook. > They're not shared with the children anyway. > > -- > Nick Kew >