Re: threads package status
| From: | Andrey Hristov | Date: | Tue, 20 Jul 2004 00:38:30 +0000 |
| Subject: | Re: threads package status | ||
| References: | 1 2 3 | Groups: | php.pecl.dev |
| Request: | Send a blank email to pecl-dev+get-987@lists.php.net to get a copy of this message | ||
Robert Janeczek wrote:
Wez Furlong wrote:Net_Server package. It includes "server" that does preforking - example how to fork. Also I think that there in PEAR there is some Fork package. Mutex you can make by using ext/sysvsem. For the callbacks ext/sysvshm may help. Also one can use ext/sysvmsg for sending messages with "tasks" (i used to implement such a "distributed" architecture example (if you are interested I can provide you more information).Don't hold your breath waiting for it to become stable enough; threads and PHP don't really mix very well, and thats due to the whole architecture of PHP; not something that can be fixed very easily without rewriting everthing.that`s sad :( my thesis is based on making php to use threads somehow :]Of course, if someone fixes the bug you mentioned and you find and it all works for you, keep using PHP, but otherwise it's better to use something else; either don't use threads (try sockets?) or don't use PHP :-/in my project there is no real option for threads :( i tried to get somehow around this problem - wanted even to use something from java (but couldn`t get java package to work at all). i saw your name along threads package commiters, so maybe you could say if there is something difficult with implementing simple threading pool extension like that: array containing php callbacks guarded by mutex, threads lock on this mutex, producer adds callbacks to the array. threads do simple fetching from array and call_user_func(). is it doable in php? what kind of traps do you see in this solution? Isn't it possible to use fork() (sorry but only *nix). In PEAR (our lovely repository) there is
rashcheers, andrey