Re: sockets
| From: | Wez Furlong | Date: | Fri, 26 Apr 2002 23:46:22 +0000 |
| Subject: | Re: sockets | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-83403@lists.php.net to get a copy of this message | ||
Threading on the level you are talking about is unlikely to happen (search
the archives!).
If what you are writing is criticial enough to need multi-threading over
multi-processing, you are probably using the wrong language :-)
BTW: Under linux, fork() is cheap and there is not much difference between
a fork()ed process and a pthread_create()ed "thread".
BTW2: socket_select() allows your script to multiplex multiple incoming
sockets without the need to fork or thread.
BTW3: ext/sysvmsg (new in CVS) might make IPC between your fork()ed
children a bit easier. I'm working on the docs right now; they will
show up in the online manual within the next couple of days.
--Wez.
On 26/04/02, "Dan Hardiker" <dhardiker@staff.firstcreative.net> wrote:
> The only feature which would be useful towards this module is threading. If
> PHP were able to thread it could handle multiple incoming sockets and
> neglegate the need for IPC between child processes (where PCNTL has been
> used) as it could all be handled by a common parent with shared (not
> copied) variables.