Multithreading in PHP

Some postings have emerged that discuss the implementation of threads in PHP. John recently referred to an article published in the English PHP Magazine and Georg wrote some valuable comments.

Shane did some work on a threads extension available in PECL a couple of months ago. The extension is very experimental.

There’s no plan to incorporate multithreading into PHP5 - if we believe the experts :)

I am not sure about how SRM can help with multithreading. At least it provides persistency across requests which allows to emulate a multithreading environment yourself in PHP (left aside if it’s a good idea e.g. to implement priority management of “threads” in PHP itself and not the Zend engine). Comments are welcome.

What’s missing is a threads implementation similar to Java or Ruby, especially with features like:
- set and manage the priority of threads
- define threads as daemons
- allow for synchronized threads (see Ruby’s Mutex Class)

One Response to “Multithreading in PHP”

  1. Learning to Cope with the Evolution of a Weblog (by Sandro Groganz) Says:

    [...] Points 1. and 2. lead to the fact that I repeatedly lost some link love, especially on Google and Technorati, because Trackbacks and Pingbacks got lost. Just recently, I managed to import all posts I wrote in my first 2 years of blogging - it’s amazing to see that some of them made it back to be listed among the most visited pages in my site stats (mostly referrals from Google). [...]

Leave a Reply

« Back to text comment

Subscribe without commenting