Hi,

I want to use :
   ap_mpm_query(AP_MPMQ_MAX_DAEMON_USED, &num_children)
at runtime (in a module) to take some maintenance actions accordingly.

Unfortunately, this (retained) data are updated by the parent process
without any visibility from the children.

So I wrote the attached patch to put the different struct
[mpm]_retained_data into shared memory (once at startup), and it works
for me...
I share here in case it can be useful for httpd, or someone.

All is done by the new ap_retained_data_share() function (similar to
ap_retained_data_create() but using a shm), which is now called by all
the (relevant) MPMs to allocate their retained data structs, falling
back to ap_retained_data_create() in case of failure.

Notes:
- in mpmt_os2, there is no retained struct, so I did not change the code here.
But there seem to be possibly multiple processes, should I create one?

- in mpm_winnt (not concerned by the patch), the value returned for
AP_MPMQ_MAX_DAEMON_USED seems weird (MAXIMUM_WAIT_OBJECTS), whereas
AP_MPMQ_MAX_DAEMONS is 1 (a single process).
Is that intended?

Thanks for your feedbacks,
Yann.

Attachment: httpd-trunk-ap_retained_data_share.patch
Description: application/download

Reply via email to