How does the Zend engine works?

General discussions related to php

Moderators: egami, macek, gesf

Post Reply
xyoon
New php-forum User
New php-forum User
Posts: 40
Joined: Fri Jun 27, 2003 10:57 pm

Sat Sep 06, 2003 10:58 pm

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.
regards

User avatar
swirlee
Moderator
Moderator
Posts: 2257
Joined: Sat Jul 05, 2003 1:18 pm
Location: A bunk in the back
Contact:

Sat Sep 06, 2003 11:25 pm

xyoon wrote: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.
Image

User avatar
Redcircle
Moderator
Moderator
Posts: 826
Joined: Tue Jan 21, 2003 10:42 pm
Location: Michigan USA
Contact:

Sun Sep 07, 2003 10:12 am

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

also check out

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

Oleg Butuzov
Last Samuray
Last Samuray
Posts: 824
Joined: Sun Jun 02, 2002 3:09 am

Sun Sep 07, 2003 10:58 pm

ZEND Engeene works perferct.

Post Reply