On Thu, 29 Jan 2004, ashish b\ wrote: > Hello , > I have Apache compiled for Prefork MPM and PHP as Loadable module > on Redhat LINUX 7.3. > 1. I have a PHP extension module which is added in the "extension=mymodule.so" > directive of php.ini. > 2. Now when Apache starts it will load the PHP module, which in turn will load the > PHP extension "mymodule.so". mymodule.so is in turn calling functions from > another > library called "myfunctions.so" and is linked with it during compilation.So the > path of function calls is Apache -> libphp4.so -> mymodule.so -> myfunctions.so > 3. I have a "test.php" script which calls functions from the extension module. > 4. If I run the script paralelly from 200 browsers then new httpd processes will be > spawned due to the load. > My question is that : > Will these newly created httpd processes reload the extension module > mymodule.so and myfunctions.so for themselves OR use the extension module which was > loaded during startup of the Apache server ? What will happen in case of CGI? > Thanks & Regards > Ashish >
I believe prefork, as its name implies, uses the fork() system call to spawn child processes. That means that it is generation an EXACT copy of the calling process in the memory, and just resuming operation from the point fork() was called. Hence when forking, every child will be a completely identical copy of the original process, no matter what was loaded in the memory space. As per CGI, in CGI the PHP *interperter* is spawned (via execv() I guess) by apache, which means everything is reloaded back from the block device per every child process loaded (=slower...) I could be wrong, though :-) > > > --------------------------------- > Do you Yahoo!? > Yahoo! SiteBuilder - Free web site building tool. Try it! -- Best regards, Shimi ---- "Outlook is a massive flaming horrid blatant security violation, which also happens to be a mail reader." -=The best way to accelerate a Windows machine is at 9.81 m/s^2=- "Windows is a 32-bit port of a 16-bit GUI for an 8-bit OS on a 4-bit CPU made by a 2-bit company that can't stand 1 bit of competition." -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php