<?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>Sat, 25 May 2013 01:56:23 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Ant Phillips' Blog: Singletons, BIRT, Theads and PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/11975</guid>
      <link>http://www.phpdeveloper.org/news/11975</link>
      <description><![CDATA[<p>
In doing some work with <a href="http://www.projectzero.org/php/">Zero</a> (PHP in Java) and the <a href="http://www.eclipse.org/birt">Eclipse Business Intelligence and Reporting Tools</a> project, <i>Ant Phillips</i> <a href="http://antblah.blogspot.com/2009/02/singletons-and-php.html">had some troubles</a> with multithreaded PHP processes and wanting them all to use the same BIRT instance insted of spawning their own.
</p>
<blockquote>
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. 
</blockquote>
<p>
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 <a href="http://www.projectzero.org/zero/sebring/latest/docs/zero.devguide.doc/zero.core/GlobalContext.html">Zero Global Context</a>. 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.
</p>]]></description>
      <pubDate>Wed, 18 Feb 2009 12:55:47 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[IBuildings Blog: Multithreading in PHP with CURL]]></title>
      <guid>http://www.phpdeveloper.org/news/9892</guid>
      <link>http://www.phpdeveloper.org/news/9892</link>
      <description><![CDATA[<p>
As mentioned on <a href="http://devzone.zend.com/article/3341-Multithreading-in-PHP-with-CURL">the Zend Developer Zone</a>, there's a <a href="http://www.ibuildings.com/blog/archives/811-Multithreading-in-PHP-with-CURL.html">new tutorial</a> posted on the IBuildings blog (by <i>Lineke Kerckhoffs-Willems</i>) about performing some multi-threading magic in PHP with the help of cURL.
</p>
<blockquote>
Each PHP request is a separate thread. There are some workarounds like using pcntl_fork, starting multiple commandline php processes using the exec command or even using ajax. Another possibility is using the Curl library. Besides the basic functions described above Curl offers the "multi" functions for retrieving content from several url's at the same time.
</blockquote>
<p>
<a href="http://www.ibuildings.com/blog/archives/811-Multithreading-in-PHP-with-CURL.html">Examples</a> are included showing how to make these "multi" requests via <a href="http://www.php.net/curl">PHP's cURL support</a> (calling URLs with a "seconds" value on the end).
</p>]]></description>
      <pubDate>Tue, 01 Apr 2008 16:23:08 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHP 10.0 Blog: We are doomed! (and Ticks in PHP)]]></title>
      <guid>http://www.phpdeveloper.org/news/8085</guid>
      <link>http://www.phpdeveloper.org/news/8085</link>
      <description><![CDATA[<p>
In <a href="http://php100.wordpress.com/2007/06/17/we-are-doomed/">this new post</a> to the PHP 10.0 blog, <i>Stas</i> mentions the "impending doom" of PHP that's been going around the community, including in <a href="http://blogs.techrepublic.com.com/programming-and-development/?p=85">this post</a> on the TechRepublic site.
</p>
<p>
He does, however, branch off into something much more interesting that seems to be somewhat ignored by developers - the use of <a href="http://www.php.net/manual/en/control-structures.declare.php#control-structures.declare.ticks">ticks</a> on their code:
</p>
<blockquote>
This is something named "ticks" - I wonder how many of the PHP developers heard about it and of those how many actually used it. Could it be used for offloading long-running I/O-bound tasks or grouping them together (e.g. so we could wait for DB and HTTP in parallel and not sequentially)? Would there be any use at all for such functionality and if so - how it's supposed to work? I.e. how would you know it's done and how you would collect and use the results?
</blockquote>
<p>
It's <a href="http://php100.wordpress.com/2007/06/17/we-are-doomed/#comments">suggested in the comments</a> that it could be used for any kind of application that might need the pseudo-multithreading it offers (including something like scripts needing multiple TCP connections).
</p>]]></description>
      <pubDate>Wed, 20 Jun 2007 10:29:00 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[AlternateInterior.com: Benchmarking PHP Threads]]></title>
      <guid>http://www.phpdeveloper.org/news/7785</guid>
      <link>http://www.phpdeveloper.org/news/7785</link>
      <description><![CDATA[<p>
In two <a href="http://www.phpdeveloper.org/news/7759">previous</a> <a href="http://www.phpdeveloper.org/news/7768">posts</a>, the AlternateInterior blog looked at working with threading in PHP. They continue along this path with <a href="http://www.alternateinterior.com/2007/05/benchmarking-php-threads.html">this new post</a> today - benchmarking some of their threading techniques.
</p>
<blockquote>
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.
</blockquote>
<p>
After updating some of <a href="http://www.alternateinterior.com/2007/05/benchmarking-php-threads.html">their HVAC class</a> to make it a little easier to understand/use, they ran some benchmarks on running processes two different ways - multithreaded and sequential.
</p>
<p>
The package is <a href="http://www.alternateinterior.com/threads/threads.20070504.tgz">available for download</a> if you'd like to work with it/run the tests yourself.
</p>]]></description>
      <pubDate>Mon, 07 May 2007 08:52:00 -0500</pubDate>
    </item>
  </channel>
</rss>
