Re: parallell execution

From: Date: Wed, 30 Aug 2000 18:00:44 +0000
Subject: Re: parallell execution
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-31287@lists.php.net to get a copy of this message
At 12:08 30/08/00 +0200, Stig S. Bakken wrote:
Manuel Lemos wrote: Hello Stig, On 29-Aug-00 10:08:27, you wrote:
In Tue, Aug 29, 2000 at 02:09:30PM +0200, Stig S. Bakken wrote:
I want this to implement "backgrounded" asynchronous I/O, which I guess is more or less what you need it for as well?
Well yes, sort of. We would need asynchronous variants of the different functions. For instance if I want to do LDAP in the background, we would need to have asynchronous LDAP functions. It would be neat to have a more general mechanism. Of course if we made an asynchronous version of fopen, I could launch new PHP interpreters through the webserver instead, and have several PHP scripts run in parallell.
Well, I'll have a look at ticks and do some more thinking on how to use it.
I heard that Perl has (will have?) a pool of interpreters read to run scripts in the Apache 2 multi-threaded environment. This means that for each Apache process there will be spare interpreters ready to run scripts threads. Anyway, I think that the lack of support to start new script processes/threads is one of the remaining things that PHP lacks and in some cases makes it an inferior solution when compared to Perl and Java servlets. I agree. Tcl has a beautifully clean C interface in that respect (at least it did back in the 7.3 days when I last touched it :-). It doesn't sound like this is too far away for PHP. We already support(?) multithreaded servers, so it's already possible to have several scripting engines running in a single process. However, usually when I assume things like this, Zeev or Andi can point out why this makes hell break loose. :-)
It is extremely hard to implement it and it would slow things down considerably because we would need to use lots and lots of mutexes in hundreds of places. We did however add ticks support which gives you some kind of ability to do background processing for slow things (i.e. opening sockets) so if it is used wisely it could be used quite nicely. Andi --- Andi Gutmans <andi@zend.com> http://www.zend.com/

« previous php.dev (#31287) next »