FYI: PHP/threads
| From: | Timm Friebe | Date: | Wed, 05 Mar 2003 19:11:40 +0000 |
| Subject: | FYI: PHP/threads | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-94806@lists.php.net to get a copy of this message | ||
I've been playing around with the (not new) idea of introducing threads
into PHP userland (maybe something to think about havin in PHP6?). What
came out of it is available at [1], offering an object oriented API (in
comparison to PECL/threads [2]).
Threads would quite likely come in handy in the following situations:
- GTK-PHP thin network client application "polling" a socket for events
(e.g., IRC client)
- Multiple simultaneous connections to slow services (for instance,
think of whois + check multiple domain names).
Both of these examples could be realized using fork() or
socket_select(), though the first is not portable and the latter
produces unnecessary overhead.
Maybe someone here would like to pick up on this idea or give some
directions to what would have to be done to make this actually work
dependably. I'm experiencing the same issues as with PECL/threads -
variable "confusion" (local function arguments with same names in two
threads affect each other), Engine unstability (Warning: ... in ... on
line -18182899), but could get a couple of samples[3] to work quite
well.
Maybe the userland API could be adopted by PECL/threads? Is anyone still
working at this or was development given up?
1] http://sitten-polizei.de/php/threads-0.1alpha.tar.gz
2] http://cvs.php.net/cvs.php/pear/PECL/threads
3] http://sitten-polizei.de/php/threads/tests/?file=mythread.php
http://sitten-polizei.de/php/threads/tests/?file=timer.php
http://sitten-polizei.de/php/threads/tests/?file=simple.php
http://sitten-polizei.de/php/threads/tests/?file=calendar.php
etc.
- Timm
Attachment: [text/x-readme] README
Attachment: [text/x-readme] README