Multicore NZ

May 5, 2011

Parallel PHP: Open Parallel and Intel

Filed under: Multicore, Open Source, Parallel Programming — multicoreblog @ 9:42 pm

James Reinders, Chief Software Evangelist of Intel, posted this blog at Intel

I’ve been chatting with a small group of dedicated fans of Intel Threading Building Blocks (TBB)  in New Zealand.  They’ve been looking at adding parallelism, using TBB, to WordPress, PHP, HipHop, Perl, and other open source projects.  They have published their code and some interesting results.  They have a web site http://openparallel.comexplaining some of their work.

The PHP (HipHip) project, using TBB, is hosted at

Their PHP wrapper has been primarily implemented as an extension for the HipHop PHP compiler. This provides a thread-safe compiled implementation of PHP 5.2 with a fairly comprehensive set of libraries.

Their first version includes:

parallel_for / parallel_for_array – provides the TBB parallel_for functionality with PHP arrays for input and output.

concurrent_vector – this PHP extension class wraps the TBB concurrent_vector and provides thread-safe access to a vector type collection.

concurrent_hash_map – this PHP extension class wraps the TBB concurrent_hash_map and provides thread-safe access to a hash collection keyed on any PHP type.

concurrent_globals – this function provides thread-safe, read-only access to the PHP global variables. (These are normally thread-local in HipHop, where a thread is typically associated with a web request).
Some PHPDoc documentation has been produced for these functions and ore is being worked on. They are also looking at conventional PHP extensions to enable application developers to run an application that uses TBB extensions in the conventional PHP interpreter for development and testing purposes. In this case, all operations will execute on a single thread. This would support single source.

They presented much of their early work in January at a conference in Australia. I couldn’t swing visiting there myself, so I’ve resigned myself to occassional emails and phone calls to catch-up with them.

Here’s what they’ve done that I’ve spoken with them about:

They made slight modifications to WordPress, to use a TBB-enabled HipHop they created – and they had VERY impressive results. The bigger surprise was the huge drop in memory footprint. They have theories why, but this seems to have been the leading reason for the higher performance. Sometime algorithm changes improve performance for unexpected reasons!  You can read their two short white papers on what they did:


I know they interested in hearing from developers of like mind (wanting to add parallelism to open source projects) – but they really enjoy talking with projects that want help improving performance. Given their results with PHP/HipHop so far, they would seem to be worth contacting for such work.

Parallelism is worth adding in many places.  It’s fun to see the results with PHP so far!

I know they are working on Perl too… I’ll catch up with them on that work and write a blog next week with what I find.

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at

%d bloggers like this: