 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
PHP Women: "I am" Contest
by Chris Cornutt 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!
voice your opinion now!
phpwomen iam contest phparchitect forum thread
WorkingSoftware.com.au: Something Like Threading- PHP Process Forking & Interprocess Communication
by Chris Cornutt 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.
voice your opinion now!
fork process communication thread tutorial fork process communication thread tutorial
Developer.com: Threads Versus The Singleton Pattern
by Chris Cornutt 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.
voice your opinion now!
thread singleton designpattern tutorial thread singleton designpattern tutorial
Sara Goleman's Blog: What the heck is TSRMLS_CC anyway?
by Chris Cornutt 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.
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!
|