Hi, > > 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 function. Cheers, Andrej -- 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