<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Sentido Web &#187; concurrencia</title>
	<atom:link href="http://sentidoweb.com/tag/concurrencia/feed" rel="self" type="application/rss+xml" />
	<link>http://sentidoweb.com</link>
	<description>Desarrollo web, HTML, CSS, Javascript, PHP, MySQL</description>
	<lastBuildDate>Wed, 28 Jul 2010 09:01:27 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Procesos concurrentes en PHP</title>
		<link>http://sentidoweb.com/2010/03/11/procesos-concurrentes-en-php.php</link>
		<comments>http://sentidoweb.com/2010/03/11/procesos-concurrentes-en-php.php#comments</comments>
		<pubDate>Thu, 11 Mar 2010 17:50:14 +0000</pubDate>
		<dc:creator>displaynone</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[concurrencia]]></category>

		<guid isPermaLink="false">http://sentidoweb.com/?p=2219</guid>
		<description><![CDATA[Buen script que nos puede ser muy útil cuando tenemos que ejecutar varios procesos concurrentes, por ejemplo realizar tareas de administración simultáneas. Para ello es necesario utilizar la función pcntl_fork(). El ejemplo es bastante sencillo, pero podemos personalizar el número de procesos que queremos que se ejecuten concurrentemente:
$maxChildren = 4;
$numChildren = 0;
foreach&#40;$unitsOfWork as $unit&#41; &#123;
 [...]]]></description>
			<content:encoded><![CDATA[<p>Buen script que nos puede ser muy útil cuando tenemos que ejecutar varios procesos concurrentes, por ejemplo realizar tareas de administración simultáneas. Para ello es necesario utilizar la función <em>pcntl_fork()</em>. El ejemplo es bastante sencillo, pero podemos personalizar el número de procesos que queremos que se ejecuten concurrentemente:</p>
<pre><code><pre class="php"><span style="color: #3E6D8F;">$maxChildren</span> = <span style="color: #cc66cc;">4</span>;
<span style="color: #3E6D8F;">$numChildren</span> = <span style="color: #cc66cc;">0</span>;
<span style="color: #723b00;">foreach</span><span style="color: #66cc66;">&#40;</span><span style="color: #3E6D8F;">$unitsOfWork</span> <span style="color: #723b00;">as</span> <span style="color: #3E6D8F;">$unit</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
  <span style="color: #3E6D8F;">$pids</span><span style="color: #66cc66;">&#91;</span><span style="color: #3E6D8F;">$numChildren</span><span style="color: #66cc66;">&#93;</span> = pcntl_fork<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
  <span style="color: #723b00;">if</span><span style="color: #66cc66;">&#40;</span>!<span style="color: #3E6D8F;">$pids</span><span style="color: #66cc66;">&#91;</span><span style="color: #3E6D8F;">$numChildren</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
    <span style="color: #808080; font-style: italic;">// do work</span>
    doWork<span style="color: #66cc66;">&#40;</span><span style="color: #3E6D8F;">$unit</span><span style="color: #66cc66;">&#41;</span>;
      <a href="http://www.php.net/posix_kill"><span style="color: #000066;">posix_kill</span></a><span style="color: #66cc66;">&#40;</span><a href="http://www.php.net/getmypid"><span style="color: #000066;">getmypid</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>, <span style="color: #cc66cc;">9</span><span style="color: #66cc66;">&#41;</span>;
    <span style="color: #66cc66;">&#125;</span> <span style="color: #723b00;">else</span> <span style="color: #66cc66;">&#123;</span>
      <span style="color: #3E6D8F;">$numChildren</span>++;
      <span style="color: #723b00;">if</span><span style="color: #66cc66;">&#40;</span><span style="color: #3E6D8F;">$numChildren</span> == <span style="color: #3E6D8F;">$maxChildren</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
        pcntl_wait<span style="color: #66cc66;">&#40;</span><span style="color: #3E6D8F;">$status</span><span style="color: #66cc66;">&#41;</span>;
        <span style="color: #3E6D8F;">$numChildren</span>--;
      <span style="color: #66cc66;">&#125;</span>
    <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></code></pre>
<p><a href="http://blog.perplexedlabs.com/2010/03/02/php-forking-to-concurrency/">PHP Forking to Concurrency with pcntl_fork()</a></p>
<p>Via / <a href="http://www.phpdeveloper.org/news/14164">PHPDeveloper.org</a></p>]]></content:encoded>
			<wfw:commentRss>http://sentidoweb.com/2010/03/11/procesos-concurrentes-en-php.php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HAProxy: proxy para mejorar el rendimiento</title>
		<link>http://sentidoweb.com/2010/02/08/haproxy-proxy-para-mejorar-el-rendimiento.php</link>
		<comments>http://sentidoweb.com/2010/02/08/haproxy-proxy-para-mejorar-el-rendimiento.php#comments</comments>
		<pubDate>Mon, 08 Feb 2010 09:23:34 +0000</pubDate>
		<dc:creator>displaynone</dc:creator>
				<category><![CDATA[Desarrollo web]]></category>
		<category><![CDATA[concurrencia]]></category>
		<category><![CDATA[proxy]]></category>

		<guid isPermaLink="false">http://sentidoweb.com/?p=2170</guid>
		<description><![CDATA[HAProxy es un proxy gratuito, con balanceo de carga y que soporta decenas de miles de peticiones. Además de tener un gran rendimiento, permite tener un control de concurrencia, esencial cuando tenemos demasiadas peticiones que nuestro sistema no puede soportar, y en vez de saturar el sistema y dar un mal servicio a todo el [...]]]></description>
			<content:encoded><![CDATA[<p><strong>HAProxy</strong> es un proxy gratuito, con balanceo de carga y que soporta decenas de miles de peticiones. Además de tener un <a href="http://haproxy.1wt.eu/10g.html">gran rendimiento</a>, permite tener un control de concurrencia, esencial cuando tenemos demasiadas peticiones que nuestro sistema no puede soportar, y en vez de saturar el sistema y dar un mal servicio a todo el mundo, podemos limitar el número de peticiones para que al menos una parte de los usuarios sí reciban el servicio adecuado.</p>
<p><a href="http://haproxy.1wt.eu/">HAProxy</a></p>
<p>Vía / <a href="http://saasinterrupted.com/2010/02/05/high-availability-principle-concurrency-control/">SaaS Interrupted</a></p>]]></content:encoded>
			<wfw:commentRss>http://sentidoweb.com/2010/02/08/haproxy-proxy-para-mejorar-el-rendimiento.php/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
