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

PHP Women:
"I am" Contest
Feb 05, 2009 @ 13:48:50

The PHP Women have started up a new contest today - their "I am" competition:

PHPWomen is delighted to announce the arrival of a new competition here at phpwomen.org. To win, all you have to do is complete this sentence: "I am a phpwomen member because..." and tell us how you got to where you are today and what brings you to the site. You should put your entry into the forum thread before the end of February.

There's no limits on who can enter ("women, men, aliens and pets") but posts that aren't in the general spirit of the competition woul dbe in danger of being deleted. The prize for the winner (besides the glory, of course) is a $50 USD gift certificate from the fine folks at php|architect.

Not a member yet? Find our more about it here!

tagged: phpwomen iam contest phparchitect forum thread

Link:

WorkingSoftware.com.au:
Something Like Threading- PHP Process Forking & Interprocess Communication
Jun 07, 2007 @ 10:21:00

New from Iain Dooley on the Working Software website today is his look at working with threading in PHP including forking and communication between the processes.

I recently wrote a little application that dumps a file across a forwarded port. [...] So when I first wrote it, I didn't know what I was doing and had never written socket code before, so it was a big procedural mess. Naturally I was keen to separate out my socket class into it's own package but this presented a problem: the controlling process needed to check the status but how could I decouple the process that instantiated the socket class from the socket code itself

So, he set about working up his class, hitting a few barriers along the way:

  • Copy On Write issues with how PHP handles the variable for the forked process
  • Interprocess Communication using Sockets using the socket_create_pair function
  • a "Curious Interlude" about why you can share sockets between two processes

There's a example of it in action - a setup with a child process that's all set to count up and respond back with the current number to the managing script.

tagged: fork process communication thread tutorial fork process communication thread tutorial

Link:

WorkingSoftware.com.au:
Something Like Threading- PHP Process Forking & Interprocess Communication
Jun 07, 2007 @ 10:21:00

New from Iain Dooley on the Working Software website today is his look at working with threading in PHP including forking and communication between the processes.

I recently wrote a little application that dumps a file across a forwarded port. [...] So when I first wrote it, I didn't know what I was doing and had never written socket code before, so it was a big procedural mess. Naturally I was keen to separate out my socket class into it's own package but this presented a problem: the controlling process needed to check the status but how could I decouple the process that instantiated the socket class from the socket code itself

So, he set about working up his class, hitting a few barriers along the way:

  • Copy On Write issues with how PHP handles the variable for the forked process
  • Interprocess Communication using Sockets using the socket_create_pair function
  • a "Curious Interlude" about why you can share sockets between two processes

There's a example of it in action - a setup with a child process that's all set to count up and respond back with the current number to the managing script.

tagged: fork process communication thread tutorial fork process communication thread tutorial

Link:

Developer.com:
Threads Versus The Singleton Pattern
Jun 01, 2007 @ 10:43:00

In a new tutorial on the Developer.com website today, they explore the difference between (and the benefits and disadvantages of) the singleton pattern versus threading in a PHP application.

Although you probably could address some [of these] issues with the judicious use of synchronized blocks, do not overlook the utility of the ThreadLocal class. In this article, I will demonstrate the risk of not accounting for Threads when using a singleton pattern and show how simple it is to address.

They start with the creation of a ThreadLocal class, one that allows the developer to communicate with the threads, and its usage. In contrast, they also create the Singleton class, showing the creation method of multiple objects of the same type.

They do, however, point out an issue that the threaded method has - unreliable results. Help is on the horizon, though, in the form of a HelperFactory class to manage the connections a bit more efficiently.

tagged: thread singleton designpattern tutorial thread singleton designpattern tutorial

Link:

Developer.com:
Threads Versus The Singleton Pattern
Jun 01, 2007 @ 10:43:00

In a new tutorial on the Developer.com website today, they explore the difference between (and the benefits and disadvantages of) the singleton pattern versus threading in a PHP application.

Although you probably could address some [of these] issues with the judicious use of synchronized blocks, do not overlook the utility of the ThreadLocal class. In this article, I will demonstrate the risk of not accounting for Threads when using a singleton pattern and show how simple it is to address.

They start with the creation of a ThreadLocal class, one that allows the developer to communicate with the threads, and its usage. In contrast, they also create the Singleton class, showing the creation method of multiple objects of the same type.

They do, however, point out an issue that the threaded method has - unreliable results. Help is on the horizon, though, in the form of a HelperFactory class to manage the connections a bit more efficiently.

tagged: thread singleton designpattern tutorial thread singleton designpattern tutorial

Link:

AlternateInterior.com:
Benchmarking PHP Threads
May 07, 2007 @ 08:52:00

In two previous posts, the AlternateInterior blog looked at working with threading in PHP. They continue along this path with this new post today - benchmarking some of their threading techniques.

All threads can now both hear and report on conditions. A problem with the original send/receive mechanism made threads hang the controlling thread while long operations were occurring.

After updating some of their HVAC class to make it a little easier to understand/use, they ran some benchmarks on running processes two different ways - multithreaded and sequential.

The package is available for download if you'd like to work with it/run the tests yourself.

tagged: thread benchmark download multithread sequential thread benchmark download multithread sequential

Link:

AlternateInterior.com:
Benchmarking PHP Threads
May 07, 2007 @ 08:52:00

In two previous posts, the AlternateInterior blog looked at working with threading in PHP. They continue along this path with this new post today - benchmarking some of their threading techniques.

All threads can now both hear and report on conditions. A problem with the original send/receive mechanism made threads hang the controlling thread while long operations were occurring.

After updating some of their HVAC class to make it a little easier to understand/use, they ran some benchmarks on running processes two different ways - multithreaded and sequential.

The package is available for download if you'd like to work with it/run the tests yourself.

tagged: thread benchmark download multithread sequential thread benchmark download multithread sequential

Link:

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.

tagged: thread communication class tutorial instance utility thread communication class tutorial instance utility

Link:

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.

tagged: thread communication class tutorial instance utility thread communication class tutorial instance utility

Link:

PHPWomen.org:
Best Practices Thread
Mar 20, 2007 @ 08:57:00

The ladies over on PHPWomen.org have opened up a new area in their forums - a place to discuss best practices in PHP.

Just a quick note that the Best Practices forum is now open and already has a couple of fast and easy articles in it for your viewing pleasure. For any aspiring writers - there is also a list of future articles if you want to try your hand at it.

There's already a few articles posted including ones discussing PHPDocumentor, spaghetti code, and variable abuse.

tagged: bestpractices thread forum articles phpdocumentor spaghetti variable bestpractices thread forum articles phpdocumentor spaghetti variable

Link: