httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sander Temme <scte...@apache.org>
Subject Re: multiple processes: but one module init needed
Date Sun, 25 Jan 2009 16:31:33 GMT

On Jan 25, 2009, at 12:35 AM, fkater@googlemail.com wrote:

> some of the initialization tasks of my module must not be
> done repeatedly with each spawned server process.
>
> Currently I init my module by ap_hook_child_init() and do
> cleaning up by apr_pool_cleanup_register(), so each spawned
> server process inits my module again.

See:

http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/examples/mod_example_ipc.c?view=co

for an example.  The post_config hook is where you want to put your  
stuff, but yes it does get called twice so you may want to use the  
construction in the example module to avoid reallocating certain items.

> Do I have to do IPC between my modules (to figure out if the
> currently loaded module is in the *first* of the spawend
> processes)?

No, just put your init code in the right hook.

>

S.

-- 
Sander Temme
sctemme@apache.org
PGP FP: 51B4 8727 466A 0BC3 69F4  B7B8 B2BE BC40 1529 24AF




Mime
View raw message