To find out, if the MPM uses multiple threads, you can use the query API
documented in ap_mpm.h (excerpt for Apache 2.0):

#define AP_MPMQ_MAX_DAEMON_USED    1  /* Max # of daemons used so far */
#define AP_MPMQ_IS_THREADED        2  /* MPM can do threading         */
#define AP_MPMQ_IS_FORKED          3  /* MPM can do forking           */
#define AP_MPMQ_HARD_LIMIT_DAEMONS 4  /* The compiled max # daemons   */
#define AP_MPMQ_HARD_LIMIT_THREADS 5  /* The compiled max # threads   */
#define AP_MPMQ_MAX_THREADS        6  /* # of threads/child by config */
#define AP_MPMQ_MIN_SPARE_DAEMONS  7  /* Min # of spare daemons       */
#define AP_MPMQ_MIN_SPARE_THREADS  8  /* Min # of spare threads       */
#define AP_MPMQ_MAX_SPARE_DAEMONS  9  /* Max # of spare daemons       */
#define AP_MPMQ_MAX_SPARE_THREADS 10  /* Max # of spare threads       */
#define AP_MPMQ_MAX_REQUESTS_DAEMON 11  /* Max # of requests per daemon */
#define AP_MPMQ_MAX_DAEMONS       12  /* Max # of daemons by config   */
#define AP_MPMQ_MPM_STATE         13  /* starting, running, stopping  */

/**
 * Query a property of the current MPM.
 * @param query_code One of APM_MPMQ_*
 * @param result A location to place the result of the query
 * @return APR_SUCCESS or APR_ENOTIMPL
 * @deffunc int ap_mpm_query(int query_code, int *result)
 */
AP_DECLARE(apr_status_t) ap_mpm_query(int query_code, int *result);

Regards,

Rainer


Gregory Nicholls schrieb:
>    Hi,
>    Is there any decent way of determining from inside a module, what mpm
> is being used ? I have to share some memory between requests, which
> needs a shared mem segment if we're using processes/kids but I can get
> away with regular mem if it thread-based or some other single-process
> mpm. Don't want to waste a shared-mem segment if I don't have to.
>    Thanks,
>          Greg.
> 
> 

Reply via email to