News Feed
Sections




News Archive
feed this:

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

PHP Women:
"I am" Contest
February 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!

0 comments voice your opinion now!
phpwomen iam contest phparchitect forum thread


WorkingSoftware.com.au:
Something Like Threading- PHP Process Forking & Interprocess Communication
June 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.

0 comments voice your opinion now!
fork process communication thread tutorial fork process communication thread tutorial


Developer.com:
Threads Versus The Singleton Pattern
June 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.

0 comments voice your opinion now!
thread singleton designpattern tutorial thread singleton designpattern tutorial


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.

0 comments voice your opinion now!
thread benchmark download multithread sequential thread benchmark download multithread sequential


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


PHPWomen.org:
Best Practices Thread
March 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.

0 comments voice your opinion now!
bestpractices thread forum articles phpdocumentor spaghetti variable bestpractices thread forum articles phpdocumentor spaghetti variable


Chris Hartjes' Blog:
Tutorial How to create a thread in vBulletin with a script
October 10, 2006 @ 08:57:00

Chris Hartjes shares a quick, simple script that can be handy for those working with vBulletin:

My day-job requires me to create code that will talk to vBulletin web sites we run. My latest task involves taking data that we get from PA Sportsticker and create posts in one of our forums. Lucky for me, somebody smarter than me figured out how to do this. It's very simple, and I've taken their work and modified it for our needs.

The code itself is only about 30 lines long, and it relies on the vBulletin libraries, but it makes it very simple to take in information (from a POSTed form) and insert it into a new topic on the message board.

1 comment voice your opinion now!
tutorial vbulletin thread create post request tutorial vbulletin thread create post request


Community News:
Lead PHP Developer Quits
July 28, 2006 @ 06:10:07

According to this new post on Slashdot, one of the lead developers of the Zend Engine has quit.

Jani Taskinen, one of the lead developers of the Zend Engine (the engine that powers PHP), as well as a lead developer for the thread safety system and other core components of the PHP project, has quit in a relatively cryptic message to the php-internals mailing list. Jani has been involved with PHP for about 6 years and his loss will undoubtedly be a big blow for the PHP project.

As the news.php.net server is apparently slowing down amazingly from the Slashdot exposure, here's a paste of the message for those interested. It's definitely a great loss to the community as a whole, and here's to hoping that someone will step up and take a place in this unfortunate hole in the development process.

If you'd like to find out more about Jani Taskinen, check out this summary of some of his contributions.

0 comments voice your opinion now!
developer quit mailing list message zend engine thread safety developer quit mailing list message zend engine thread safety


Sara Goleman's Blog:
What the heck is TSRMLS_CC anyway?
June 02, 2006 @ 05:56:55

Sara Goleman, a definite specialist in the internals of PHP, has posted This new item on her blog today with details on a construct that's a bit mysterious, but pervasive in the code - TSRMLS_CC.

Those who know what this is typically answer questions from those who don't with "Don't worry about what it is, just use it here here here and here. And if the compiler says you're missing a tsrm_ls, put it there too..." This isn't laziness on the part of the person answering the question (okay, maybe it is a little bit), it's just that the engine goes so far out of its way to simplify what this magic values does, that there's no profit in a new extension developer knowing the mechanics of it. The information is like a cow's opinion, it doesn't matter, it's Moo.

Since I love to listen to myself rattle on about pointless topics (and I havn't blogged much this month), I thought I'd cover this topic and see if anyone manages to stay awake through it.

In the remainder of the post, she breaks it down into its components and explains what each means. At its base level, it helps manage the differences between code using the "Zend Thread Safety" functionality and the code that's not. To illustrate the point, she provides two examples - one with globals and one with "non-global globals". Of course, this functionality isn't any good if you can't get to the constructs you need, so she includes an example macro to accomplish just that.

1 comment voice your opinion now!
source tsrmls_cc thread resource zend local storage source tsrmls_cc thread resource zend local storage



Community Events





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


bugfix application threedevsandamaybe configure release introduction podcast series community library framework wordpress project api code language developer laravel list interview

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