Re: How php works?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



# maillist.kai@xxxxxxxxx / 2006-12-13 14:15:26 +0800:
> I'm new here and looking PHP these days, howerver , I'm confused by how it
> works, and here is some questions I have.
> Is there any old bird wanna help me out?
> 
> 1. I heard there is a zend engine inside PHP playing the role as a virtual
> machine, and PHP excution have 2 step, first compile to opcode and then
> excute the opcode,
> so is that means the php are compiled only once per file? or still need to
> recompile when another request issued to the server? also I heard about the
> caching extention about php, is it talking about caching the opcode? is't
> caching the opcode or excute results? how it shares between the requests?

Both kinds of things exist, with different sharing strategies.
 
> 3. Take linux apache for example, if compiled as a apache module, and using
> prefork threading model, for example, if I have 100 process, is that means I
> have 100 copy of PHP library local data(I assume only one reentrant
> excutable image) in each process? compare to a worker model, like 10 process
> and 10 threads in each one process, should it make a difference that we only
> have 10 copy of PHP library local data ?

Practical concerns make your question moot: even if the basic
distribution was all threadsafe, you're bound to hit a library that uses
strtok(3) or strerror(3), or static variables. How much of the code you
rely on is labelled by its authors as threadsafe?

-- 
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man.  You don't KNOW.
Cause you weren't THERE.             http://bash.org/?255991

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux