httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrej van der Zee" <>
Subject Re: Apache modification questions
Date Fri, 05 Sep 2008 09:49:53 GMT

> A CGI script is run by the code of a module, mod_perl, mod_php5, etc.
> In their register_hooks function they register their handler, which is
> a script interpreter basically. The handler callback is invoked in the
> same thread that did the rest of the request processing (URL parsing,
> authentication, fixups, etc). However, I don't know if the handler
> callback (of mod_perl, mod_php5, etc), which can be seen as a sort of
> third-party black box, spawns new processes/threads in which they
> parse the script, compile, etc. I guess they do not spawn new
> threads/processes but you have to read their docs or their sources in
> order to be sure. If they do not spawn new threads/processes, then the
> CGI is executed in the same thread as fixups and the rest of the
> request processing.

Thanks that makes sense.

If understood correctly, this means that I can add my own module to
the chain of request processors that executes in the same thread as
the hook function in mod_php5/mod_perl that executes CGI scripts.
Though, if the module's hook function spawns a new process/thread for
handling the CGI script is dependent on the module.

Does anybody know if the hook functions of such modules usually
spawning a new thread/process? My guess is that at least for compiled
CGI application written in C/C++ a new process is forked in the hook


Andrej van der Zee
2-40-19 Koenji-minami
Suginami-ku, Tokyo
166-0003 JAPAN
Mobile: 0031-(0)80-65251092
Phone/Fax: 0031-(0)3-3318-3155

View raw message