Re: Multi-thread programming in PHP?

From: Date: Wed, 17 Apr 2002 14:25:49 +0000
Subject: Re: Multi-thread programming in PHP?
References: 1 2  Groups: php.dev 
Request: Send a blank email to php-dev+get-82905@lists.php.net to get a copy of this message
Forking is more like multi-processing, not threading, as a new process is started up each time you fork. Real UNIX threads are generally done using either POSIX threads (pthreads) or native threads, which can vary depending on the UNIX platform. (UNIX International threads, for instance, on Solaris. They both provide the same functionality, but pthreads are more portable since they're a POSIX standard.) J Dave Mertens wrote: > On Wed, Apr 17, 2002 at 01:26:05PM +0300, Topi Maenpaa wrote: >> Are there any plans of incorporating multi-thread support to the PHP >> programming language? I haven't been able to find any initiative of this >> kind, and I was just wondering if anyone is even planning to do it. In a >> project I'm currently involved in the need for multiple threads is really >> critical, and the absence of such a feature unfortunately renders PHP >> useless. Otherwise it could be just a perfect choice. > PHP has threading support in the way of forking, The normal *nix way of > threading. This library is called Process Control functions > (http://nl2.php.net/en/ref.pcntl.php). But this only works in the CGI > (console) version of PHP. > >> Is it even possible to create multiple threads in the current PHP >> version? Any estimations of the amount of work required? I have no >> experience on Windows, so someone should anyway convert pthreads to their >> Windows correspondents. > This kind of threading (forking) only works in *nix enviroments. As far as > i know PHP doesn't support Windows threading. Very cool stuff for daemons > :-) Also the *nix signals (sighup, sigint, etc) are supported. > > Have fun! > > Dave Mertens

« previous php.dev (#82905) next »