<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Thu, 23 May 2013 18:33:56 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[PHPBuilder.com: PHP Multithreading with cURL]]></title>
      <guid>http://www.phpdeveloper.org/news/16455</guid>
      <link>http://www.phpdeveloper.org/news/16455</link>
      <description><![CDATA[<p>
On PHPBuilder.com <i>Jason Gilmore</i> has posted a new tutorial about how to handle a more true version of multi-threading (non-native, of course) in a PHP application making HTTP requests. His <a href="http://www.phpbuilder.com/columns/Jason_Gilmore06072011.php3">method uses cURL</a>, the popular extension that make working with socket connections a lot simpler.
</p>
<blockquote>
This article explains an alternative solution that consists of sending multiple HTTP requests to the same Web server on which PHP is running. Each HTTP request triggers the execution of a different task. Many requests can be run at the same time without having to wait for each one to finish. [...] As you may know, PHP has no native support for multithreading like Java, but using the cURL extension makes multithreading possible in PHP.
</blockquote>
<p>
He introduces cURL a bit, talking about the protocols it supports and  how to check and see if you have the extension installed. He then walks through a sample connection, calling curl_setopt and curl_exec to fetch a remote page from a website. The real fun comes in when you use the curl_multi_add_handle and curl_multi_exec methods to run more than one request in parallel. 
</p>]]></description>
      <pubDate>Fri, 10 Jun 2011 11:08:58 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Jack Slingerland's Blog:  24 PHP Dark Arts: Multi-Processing (Series)]]></title>
      <guid>http://www.phpdeveloper.org/news/15219</guid>
      <link>http://www.phpdeveloper.org/news/15219</link>
      <description><![CDATA[<p>
<i>Jack Slingerland</i> has a series of new posts to his blog looking at a method for multi-processing in PHP applications and some of the considerations of forking off processes from a main script.
</p>
<blockquote>
Of all the glorious programming languages in existence, you've chosen to work with PHP.  Okay, maybe you were forced to, but that doesn't mean you can't have fun right?  Hmm, fun...What' fun?  Threading, race conditions, and deadlocks.  Sounds like loads of fun!  But alas, PHP doesn't have functionality to cover this.  True, but the host operating system does.  We can just fork processes manually like in the good 'ole days' and then ride off into the sunset.  But we shouldn't do that, it's wrong.  It's taking advantage of PHP.  Bah! We're going to do it anyways.  And FOR THE LOVE OF GOD, do not do this in production code.  If you need multi-threading, use a different language.
</blockquote>
<p>Here's the three parts of the series:</p>
<ul>
<li><a href="http://www.re-cycledair.com/php-dark-arts-multi-threading-part-1">PHP Dark Arts: Multi-Processing (Part 1)</a> (Introduction)
<li><a href="http://www.re-cycledair.com/php-dark-arts-multi-processing-part-2">PHP Dark Arts: Multi-Processing (Part 2)</a> (Priority and Signals)
<li><a href="http://www.re-cycledair.com/php-dark-arts-shared-memory-segments-ipc">PHP Dark Arts: Multi-Processing (Part 3)</a> (Shared memory segments)
</ul>
<p>
If you'd like to download the source he's created during these three posts, you can <a href="http://www.re-cycledair.com/wp-content/uploads/2010/09/shared_memory.zip">grab it here</a>.
</p>
]]></description>
      <pubDate>Fri, 01 Oct 2010 13:49:07 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[AlternateInterior.com: Multi-Threading Strategies in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/7759</guid>
      <link>http://www.phpdeveloper.org/news/7759</link>
      <description><![CDATA[<p>
On AlternateInterior.com, there's <a href="http://www.alternateinterior.com/2007/05/multi-threading-strategies-in-php.html">the start of something</a> that could be used to speed up the execution of your app - multi-threading in PHP.
</p>
<blockquote>
<p>
PHP does not have threading anywhere in its massive core. We can, however, fake it by relying on the underlying operating system's multitasking abilities instead of PHP. This article will show you how.
</p>
<p>
PHP has no built in support for threading. But there can still be times when you've got lengthy code to run and idle CPU cycles you'd like to capitalize on. We can treat child processes as threads. 
</p>
</blockquote>
<p>
He (<i>Brian Bosh</i>) <a href="http://www.alternateinterior.com/2007/05/multi-threading-strategies-in-php.html">uses the example</a> of executing five other PHP scripts inside of another through the use of a multi-threading class he's developed. Included is the code for both the class and the example code to use it.
</p>]]></description>
      <pubDate>Wed, 02 May 2007 15:29:00 -0500</pubDate>
    </item>
  </channel>
</rss>
