News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

AlternateInterior.com:
Communicating with threads in PHP
May 03, 2007 @ 13:38:16

Continuing on from a previous post on multi-threading in PHP, Brian Bosh is back with something a bit more developed that will allow for communication between the threads as well.

Earlier this week, I suggested PHP could be multithreaded. The sample I provided was very simple and at least one reader quickly wondered how to communicate with threads. If you haven't already, take a look at part 1 to get some basic information about threads in PHP.

It took a bit longer to get that part working that simple threads, but as of now, I have a functional prototype of an HVAC thread.

The post is broken up into five different files to make things work:

  • an overall class for the main functionality (their example of running the heater or AC)
  • a class to create and set up a thread
  • a "thready utility" class to handle the response from a thread
  • a thread library to handle creation/interaction/etc
  • the example file of the system in use
Following the code, he gives a nice explanation of how things work and how they all fit together.

0 comments voice your opinion now!
thread communication class tutorial instance utility thread communication class tutorial instance utility


blog comments powered by Disqus

Similar Posts

Rob Allen's Blog: Updated Tutorial for Zend Framework 1.5

Gonzalo Ayuso: Handling several DBALs in Symfony2 through the Dependency Injection with PHP

NETTUTS.com: Mimicking Apple's Address Book for the Web

DevShed: Refactoring the MySQL Abstraction Class with the Active Record Pattern

Joey Rivera's Blog: Using Zend_Paginator with Twitter API and Zend_Cache


Community Events

Don't see your event here?
Let us know!


introduction conference php7 interview framework voicesoftheelephpant series xdebug release library example podcast api community laravel extension version opinion symfony2 performance

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework