I am curious to know how the zend engine works.
I have searched through the net but could not find the explanation for the following question:
When a client requests a php page, how does the zend engine response to it?
what I mean is that does the engine create a new thread for each page requested or a new thread for few request of the same page.
Or perhaps a process? (but this would resemble a CGI)
And why it seems like there is not thread programming in php, does the php engine guarantee that all php pages are thread-safe. How about a global variable? Does a global variable in php only stay within the scope of a particular request or session only?
I would appreciate any explanations.
Thank you very much.
zend compiles and caches scripts to optimize it's execution.
Some info I've found:
Zend also features a thread-safe resource manager to provide better native support for multithreaded Web servers. This requires you to allocate local structures for all of your global variables to allow concurrent threads to be run. Because the thread-safe mode of Zend was not finished back when this was written, it is not yet extensively covered here.
http://us2.php.net/manual/en/zend.layou ... gement.php