 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
Perplexed Labs Blog: PHP Forking to Concurrency with pcntl_fork()
by Chris Cornutt March 10, 2010 @ 13:05:59
On the Perplexed Labs blog there's a recent post looking at how to fork processes in PHP with the help of the pcntl_fork function and the process management extension.
Let's say you want to take advantage of more than one core for a given process. Perhaps it performs many intensive computations and on a single core would take an hour to run. Since a PHP process is single threaded you won't optimally take advantage of the available multi-core resources you may have. Fortunately, via the Process Control (PCNTL) extension, PHP provides a way to fork new child processes.
He gives a quick snippet of code showing how to spawn off a few new processes, get their process IDs and watches a max number of children until one dies (then starts another).
voice your opinion now!
process control extension tutorial concurrency pcntlfork
Ibuildings techPortal: Coding Is The Easy Part
by Chris Cornutt February 17, 2010 @ 09:56:31
On the Ibuildings techPortal there's a new article from Johanna Cherry that takes a look at the full development life-cycle and points out that the actual coding of the application, that's the easy part.
Engineering software is so much more than coding. As a software engineer you take on several roles throughout the software development life cycle. Let us take a look at some key roles that developers play during the software development life cycle, some problems you can run into, and how to solve them.
She talks about the different roles of those involved in the parts of the process, the ones that make it all fit together like a well-oiled machine: the Planner, the Architect, the Coder, the Refactorer, the Tester and the Documentor. Each has their place in the process and to keep things running smoothly, they all need to be doing the best they can. Sometimes this also means that one person performs more than one role, depending on the situation and the need.
voice your opinion now!
coding opinion engineer software process
IBuildings Blog: 137 CMS Systems
by Chris Cornutt December 18, 2009 @ 11:07:38
In this new post from the IBuildings blog today Ivo Jansch looks at content management systems and how you can start to find that right fit for your and your company/organization.
At the moment, Wikipedia's list of content management systems features 137 unique CMS products. 59 of these are written in PHP. And that's only the ones that Wikipedia finds 'notable', which means these are the ones that have significant usage or large enough communities to be mentioned. [...] The sheer size of the CMS market is interesting when you consider that one of the most frequent questions we get at Ibuildings is: "What CMS do you recommend we use?"
In an experiment in his recent talk (at the IMS conference) he asked the audience which car he should purchase from his list of four. Of course, their answers were wrong because of one fact - no one asked about his requirements.
This is a definite first step to anyone looking for a CMS to fit their needs (or really any kind of software). He also mentions other criteria to consider like cost of ownership, technology required, features and functional requirements.
voice your opinion now!
cms content manage selection process requirements
Padraic Brady's Blog: Mysteries Of Asynchronous Processing w/PHP - Pt 3 Spawned Child Processes
by Chris Cornutt October 01, 2009 @ 12:35:23
Padraic Brady has posted part three of his look at asynchronous processing in PHP applications today. The previous two parts introduced you to the topic and got you ready to work with child processes in a Zend Framework application. This latest part gets into the code showing how to fork the processes and handle communication between them.
With the theory heavy portion of the series out of the way, we can begin to explore the various implementation possibilities. In this part, we will examine implementing Asynchronous Processing using a child process, i.e. a separate PHP process we create from our application during a request. We'll analyse this implementation option before introducing the source code so we may understand its advantages and disadvantages.
He looks at both the advantages and disadvantages of processing with child processes and suggests a method to get a handle on the processes rather than just spawning new processes - forking. Some basic code examples are included, using the popen function to open the new child process and a Zend Framework example.
voice your opinion now!
spawn child process asynchronous tutorial
Padraic Brady's Blog: The Mysteries Of Asynchronous Processing With PHP - Part 1
by Chris Cornutt September 28, 2009 @ 10:48:30
Padraic Brady has started up a new series of posts to his blog on the topic of asynchronous processing with PHP.
Imagine a world where clients will give up on receiving responses from your application in mere seconds, where failed emails will give rise to complaints and lost business, where there exist tasks that must be performed regularly regardless of how many requests your application receives. This is not a fantasy world, it's reality. [...] Asynchronous processing is a method of performing tasks outside the loop of the current request. Basically, you offload the task to another process, leaving the process serving the request free to respond quickly and without delay.
He talks about some of the problems that asynchronous processing solves (like tasks that must be completed despite errors) and starts to outline a simple processing structure with child processes and task handling.
voice your opinion now!
asynchronous process benefit task
Brian Moon's Blog: Forking PHP!
by Chris Cornutt July 24, 2009 @ 09:25:18
In a new post from Brian Moon looking at how they're (DealNews) using forking in PHP applications to handle some of their Gearman processing.
While at the OReilly Open Source Convention in 2009, we were asked about how we pulled this off. So, we are releasing the two scripts that handle the forking and some instructions on how we use them. [...] These are the scripts we use to manage long running processes. They work great for us on Linux. They will not run on Windows at all. We also never had any trouble running them on Mac OS X.
The two scripts (that you can grab on their developer site) show two methods for running child processes and how to pass off requests to each one to be handled in turn.
voice your opinion now!
pcntl fork process
Buildmeister.com: Automating the PHP deployment process with Phing, dbdeploy and FTP
by Chris Cornutt April 03, 2009 @ 11:17:41
On the Buildmeister blog there's an article detailing a setup for an automated project deployment process using Phing, dbdeploy and FTP.
A "well defined" build and deployment process (supported by a number of key tools or scripts) can often help reduce errors and increase the quality of delivered applications. In comparison with other languages, the PHP community has been somewhat slow in implementing build, deployment, code inspection and testing tools, however there are now a sufficient number available that have reached maturity.
They walk through what each tool is, how to configure them to work with each other and even on different environments (different development areas). Some configuration files and settings are included. The database deployment (with dbdeploy) is slightly different but can still be hooked into Phing and include a logging system (to a database table) for any updates.
voice your opinion now!
deployment phing dbdeploy ftp configure process automation
Blue Parabola Blog: On Writing CDC
by Chris Cornutt March 27, 2009 @ 10:24:50
On the Blue Parabola blog Matthew Turland has written up a post about working with the CDC, the Ceres Document Checker - a project he's developed to check documents based on the Ceres document format.
If you've written or done editing for php|architect before, you're probably familiar with the custom markup format they use called Ceres, which looks a bit like Markdown. Both articles and books use it, though each has slightly different formatting requirements. Some of these requirements can be tedious to check for and easy to miss. As much as I've been working with documents in the format, I decided to write a tool to help me out.
He outlines the requirements he wanted to follow including that it could be run from the command line, that it could detect code blocks, it could perform lint checks on the code samples and it could give a rough word count excluding code. He also includes his three methods for processing - finding a file and checking it, recursing through a directory and finding files matching a regular expression.
Files are pulled in and processed line-by-line until a code block is reached. This is processed via a regular expression and the script continues on. If you're interested in the code, you can check out the latest version from the project's github page. There's also a TextMate bundle (written by Davey Shafik) for those users of the TextMate editor.
voice your opinion now!
ceres doucment checker project github process
Ant Phillips' Blog: Singletons, BIRT, Theads and PHP
by Chris Cornutt February 18, 2009 @ 12:55:47
In doing some work with Zero (PHP in Java) and the Eclipse Business Intelligence and Reporting Tools project, Ant Phillips had some troubles with multithreaded PHP processes and wanting them all to use the same BIRT instance insted of spawning their own.
The problem is that BIRT needs to be started once, and only once, in any given process. Once it has been started up, then it is plain sailing to load reports and render them to HTML. The BIRT runtime should be kept around until the process shuts down.
Two problems came up with this approach - if each PHP process makes its own BIRT process any settings/current data will be wiped out and the BIRT instance would go away whenever the PHP script finishes. He found something that solves both of these problems - the Zero Global Context. Its a "storage area" that can contain just about anything. He used it to store the BIRT runtime until its told to finish and die off.
voice your opinion now!
birt java zero multithread singleton process global context
|
Community Events
Don't see your event here? Let us know!
|