httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick Kew <n...@webthing.com>
Subject Re: How to detect at runtime if this is a prefork or threaded server?
Date Fri, 13 Oct 2006 16:29:14 GMT
On Friday 13 October 2006 17:10, Roland Genske wrote:
> Hello all,
>
> is it possible for a module to detect at runtime whether it runs in
> a "prefork" server or in a "worker" (threaded) server? Our module
> must behave differently depending on this.

You already got the straight answer.

There's an alternative that might be worth looking at, depending on
what your module does that prompts the question.  You can also use 
APR definitions

#if APR_HAS_THREADS
    ... do thready things ...
#else
    ... do non-thready things ...
#endif

This will give different results to ap_mpm_query, as Prefork can
be built on a threaded APR.

-- 
Nick Kew

Application Development with Apache - the Apache Modules Book
http://www.prenhallprofessional.com/title/0132409674

Mime
View raw message