Jochem Maas wrote:
David Zülke schreef:
Am 17.07.2008 um 11:36 schrieb Mario Brandt:
I made a test on my console (cmd.exe)
ENV: WinXP SP 3 all updates, PHP 5.2.6 / PHP 5.2.6 non thread safe
(NTS)
Intel Celeron 2.4 GHz 1 GB DDR Ram
It showed that the non thread safe is faster than the thread safe
version.
And your point/question is...?
hmmm. can't speak for Mario but reading this caused a few questions to
pop up in my head.
Im an average joe php'er trying to write secure and fast code,
I am aware of threads and processes and the general issues but don't
understand the gritty details of implementing reentrant [C] code (is that
the right word??)
I know that running php in a threaded env is a no-no due mostly to
certain extension being [probably] not thread safe - an uncertainty factor
not suitable for production, at least so I have been led to believe
by comments made by core php devs. (is this [still] true?)
now the question part ...
a, what are the ramifications of having to run php without threading
when we live in a world that's increasingly moving towards
multi-core/multi- CPU systems?
If the web server is threaded you get crashes!
b, Is php not missing out here big time?
Nope, you can still execute multiple processes on different processors
even if they aren't threaded.
d, Will threads ever become recommended in/for php?
This is to do with the way PHP is executed not to do with the code users
create.
e, If threads become the norm, will php code have to be written
differently to account for threads?
See Above.
f, are there things I can/should be doing to my [production]
systems/software-stacks to leverage extra performance for my php
code from CPUs with multiple cores (and/or machines with multiple
CPUs)?
FastCGI is fine, each process can be executed on seperate CPUs.
g, am I worrying about nothing? :-)
Yes you're worring about nothing. It's to do with the environment that
PHP is executed in. Apache and IIS on Windows are threaded by default so
you need a threaded version of PHP or you'll get crashes.
If you use FastCGI then the non-thread safe version is fine.
David
Scott
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php