<?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 18:34:00 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Jonathan Hill:  Video: Multi-tasking in PHP (from Atlanta PHP)]]></title>
      <guid>http://www.phpdeveloper.org/news/18965</guid>
      <link>http://www.phpdeveloper.org/news/18965</link>
      <description><![CDATA[<p>
<i>Jonathan Hill</i> has <a href="http://jonathonhill.net/2012-12-19/video-multi-tasking-in-php/">posted the video</a> of his recent presentation at the <a href="http://atlantaphp.org">Atlanta PHP User Group</a>, "Multi-tasking in PHP".
</p>
<blockquote>
When it comes to multi-tasking and interacting with the operating system, PHP is no lightweight. In this December 6, 2012 presentation Jonathon Hill (<a href="http://twitter.com/compwright">@compwright</a>) explores PHP's little-known POSIX, Process Control, and Semaphore extensions and shows you how to introduce a parallel dimension to your applications.
</blockquote>
<p>
<a href="http://www.slideshare.net/compwright/multiprocessing">His presentation</a> covers the use of multi-tasking to accomplish some common tasks in PHP (like batch processing or creating daemons). He talks about multi-processing vs multi-threading, forking, race conditions and semaphores.
</p>
<p>
You can watch the <a href="http://vimeo.com/55950992">video</a> of the presentation over on Vimeo and check out the software and links to other resources mentioned in the talk in <a href="http://bitly.com/atlphpm">this link bundle</a>.
</p>]]></description>
      <pubDate>Fri, 28 Dec 2012 11:33:15 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Jonathan Hill: What Is Wrong With PHP's Semaphore Extension]]></title>
      <guid>http://www.phpdeveloper.org/news/18893</guid>
      <link>http://www.phpdeveloper.org/news/18893</link>
      <description><![CDATA[<p>
In <a href="http://jonathonhill.net/2012-12-08/what-is-wrong-with-phps-semaphore-extension/">this recent post</a> to his site <i>Jonathan Hill</i> takes a look at the PHP <a href="http://php.net/manual/en/book.sem.php">semaphore extension</a> and talks about some of the issues he's had with it.
</p>
<p>He lists five different pain points he discovered when trying to use the extension:</p>
<ul>
<li>Lack of a true Semaphore
<li>Undefined error handling
<li>Undefined behavior of sem_get()
<li>Cannot disable semaphore auto-releasing
<li>A semaphore may be deleted when other processes are waiting to acquire it
</ul>
<p>
The <a href="http://php.net/manual/en/intro.sem.php">semaphore extension</a> provides a PHP-based wrapper for the System V IPC family of functions (including semaphores, shared memory and inter-process messaging).
</p>]]></description>
      <pubDate>Fri, 14 Dec 2012 11:08:18 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Dave Marshall's Blog: Defending against Cache Stampedes]]></title>
      <guid>http://www.phpdeveloper.org/news/17393</guid>
      <link>http://www.phpdeveloper.org/news/17393</link>
      <description><![CDATA[<p>
<i>Dave Marshall</i> has a new post to his blog showing one method for <a href="http://davedevelopment.co.uk/2012/01/13/defending-against-cache-stampedes.html">defending against cache stampedes</a> from assaulting your caching servers and (possibly) bringing them down.
</p>
<blockquote>
I've recently had a problem with a rather large operation (that could probably be optimised considerably, but nevermind), where by if the cached result of the operation expired, several web server threads would attempt the operation, causing some major headaches for our database and web servers. This is something I've come across before, and is commonly(?) known as a <a href="http://en.wikipedia.org/wiki/Cache_stampede">Cache Stampede</a>. This is bad, this post describes the basics of what I've done to deal with it.
</blockquote>
<p>
His example uses a Zend_Cache interface to Memecache, but it could be applied in other places too. His method uses a <a href="http://en.wikipedia.org/wiki/Semaphore_%28programming%29">binary semaphore</a> to check and see if there's a "lock" and sleep for a bit before checking again. Sample code is included showing how to create this system and how to refresh the data with a new expiration on a cache miss.
</p>]]></description>
      <pubDate>Fri, 13 Jan 2012 13:13:08 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Paul Reinheimer's Blog: PHP BUG - err mm:core: failed to open semaphore file]]></title>
      <guid>http://www.phpdeveloper.org/news/13516</guid>
      <link>http://www.phpdeveloper.org/news/13516</link>
      <description><![CDATA[<p>
<i>Paul Reinheimer</i> came across <a href="http://blog.preinheimer.com/index.php?/archives/343-PHP-BUG-err-mmcore-failed-to-open-semaphore-file.html">a small bug</a> in a recent PHP 5.2.x release of the language - a debugging message left in by mistake.
</p>
<blockquote>
If you get an error when PHP launches along the lines of: "PHP Warning: PHP Startup: mm_create(0, /var/www/phpSessionStorage/session_mm_cli1000) failed, err mm:core: failed to open semaphore file (Permission denied) in Unknown on line 0" you're going to either need to upgrade to PHP 5.3.0 or wait for PHP 5.2.12.
</blockquote>
<p>
It seems that some debugging code made it into the core code (but it's been corrected in the branches). 
</p>]]></description>
      <pubDate>Wed, 11 Nov 2009 09:23:51 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Zend Developer Zone: Zend Weekly Summaries Issue #322]]></title>
      <guid>http://www.phpdeveloper.org/news/7181</guid>
      <link>http://www.phpdeveloper.org/news/7181</link>
      <description><![CDATA[<p>
The latest <a href="http://devzone.zend.com/node/view/id/1599">weekly summary</a> for the PHP mailing lists has been posted over on the Zend Developer Zone. This week, discussions included:
<ul>
<li>Sandboxed semaphores
<li>Focus on *printf [continued]
<li>PHP 5.2.1 RC2 and PHP 4.4.5 RC1
<li>It's all in the HEAD
</ul>
Descriptions of each of <a href="http://devzone.zend.com/node/view/id/1599">the headings</a> are provided, including code and a "short version" for those on the run.
</p>
<p>
Be sure to check back <a href="http://devzone.zend.com/public/view/tag/Weekly_Summaries">each week</a> for a new summary.
</p>]]></description>
      <pubDate>Mon, 29 Jan 2007 12:27:00 -0600</pubDate>
    </item>
  </channel>
</rss>
