How does the Zend engine works?

A

Anonymous

Guest
Hi all,

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:

Question1
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)


Question2
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.
 
xyoon said:
How about a global variable? Does a global variable in php only stay within the scope of a particular request or session only?

The answer to this bit is yes.

The rest of your questions are beyond the scope of my interest.
 
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.layout.memory-management.php

also check out

http://www.zend.com/store/products/zend-engine.php
 
Back
Top