RE: [PHP] Multithreading for OOP PHP
| From: | marco@behnke.biz | Date: | Wed, 31 Oct 2012 10:57:11 +0000 |
| Subject: | RE: [PHP] Multithreading for OOP PHP | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-319632@lists.php.net to get a copy of this message | ||
"Florian Müller" <florian-mueller@outlook.com> hat am 31. Oktober 2012 um 11:37
geschrieben:
> I actually tought about just the same structures as Java uses(something in
> this way:
> Thread t = new Thread(new Runnable() { public void run() { ....blabla
> }}
> I thought this would actually be a good benefit if PHP supported this. It's
> just as we sometimes use PHP for doing some big Server works (e.g. database
> copying or something) and it would be nice to controll by yourself which
> Thread (or process) does which part of the job.
> For normal HTTP calls which must be handled within milliseconds, this actually
> does not make sense, that's right ;)
Yeah, it does not make sense for the Response script.
But it if PHP would be threadsafe, you would be able to run the Apache in a much
faster and less memory using way.
There once was a configure option in PHP to compile it threadsafe, but they
dropped it for a reason.
And if thinking of PHP as the CGI handler or even as the webserver itself, it
would be great if we could use threads instead of forking processes.
--
Marco Behnke
Dipl. Informatiker (FH), SAE Audio Engineer Diploma
Zend Certified Engineer PHP 5.3
Tel.: 0174 / 9722336
e-Mail: marco@behnke.biz
Softwaretechnik Behnke
Heinrich-Heine-Str. 7D
21218 Seevetal
http://www.behnke.biz