Re: I want to write a Multi-threaded PHP Application

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



D. Dante Lorenso wrote:
I've already written the multi-threaded server using Java. I want to do this in PHP, however, because the PHP "threads" can re-use PHP classes I've already written and hence standardize on a single codebase and language. Many other languages have threads (Java, C#, Python, Ruby, etc) ... which is why I'm so amazed PHP does not even list Threads as a priority. You simply can't be an enterprise language without these basic features. Of course, don't get me started on namespaces too ;-)

No, choosing a different language has been considered and I'd rather continue with my hacked multi-process PHP server solution before I am ready to change to a different language.

As many other posters have pointed out, PHP does not support threads, and is not likely to in the near future. It's not a 'basic' feature when the language background is web-based scripting. None of the languages you mention that do support threading were designed for web-based usage.

IMHO, if your main goal is to allow your threaded app to reuse existing PHP classes then your best bet is to investigate embedding PHP into something written in C or C++.

<rant>
As far as your "hacked multi-process PHP server solution" goes, I would suggest that you think about what is important to you for this project. If your existing solution is good enough for your purposes then live with it. If the only reason you're not willing to replace it with a solution that would undoubtedly be faster, more stable and more efficient is because you don't want to re-implement some existing code that only exists in the wrong language, that's your choice. If it were me, the goal of code reuse would never prevent me from using the right tool for the job, but that's just me.
</rant>

-Stut

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux