<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Multithreading in php</title>
	<atom:link href="http://blog.motane.lu/2009/01/02/multithreading-in-php/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.motane.lu/2009/01/02/multithreading-in-php/</link>
	<description>Ramblings about software development</description>
	<lastBuildDate>Thu, 02 Feb 2012 17:38:29 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Tudor</title>
		<link>http://blog.motane.lu/2009/01/02/multithreading-in-php/comment-page-2/#comment-5219</link>
		<dc:creator>Tudor</dc:creator>
		<pubDate>Fri, 27 Jan 2012 00:26:41 +0000</pubDate>
		<guid isPermaLink="false">http://blog.motane.lu/?p=40#comment-5219</guid>
		<description>I don&#039;t think your code got pasted right. Use 
&#091;code lang=&quot;php&quot;] ... &#091;/code]
to paste properly.</description>
		<content:encoded><![CDATA[<p>I don&#8217;t think your code got pasted right. Use<br />
&#91;code lang=&#8221;php&#8221;] &#8230; &#91;/code]<br />
to paste properly.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: victor wallin</title>
		<link>http://blog.motane.lu/2009/01/02/multithreading-in-php/comment-page-2/#comment-5217</link>
		<dc:creator>victor wallin</dc:creator>
		<pubDate>Thu, 26 Jan 2012 23:58:18 +0000</pubDate>
		<guid isPermaLink="false">http://blog.motane.lu/?p=40#comment-5217</guid>
		<description>what do you think about this solution? (Runs on Linux (slackvare) 2.6.27.7)

PHP 5.2.11 (cli) (built: Oct  2 2009 17:30:20)


&lt;?php
require_once( &#039;Thread.php&#039; );
if ( function_exists(&#039;sem_get&#039;) )echo &quot;sem&quot;;
   // test to see if threading is available
if( ! Thread::available() ) {
        die( &#039;Threads not supported&#039; );
}
// function to be ran on separate threads
function paralel( $_limit, $_name ,$lock) {
        sem_acquire($lock);
        for ( $index = 0; $index start( 10, &#039;t1&#039;,$s1);
$s2 = sem_get(2);
$t2-&gt;start( 10, &#039;t2&#039;,$s2);
// keep the program running until the threads finish
sem_acquire($s1);
sem_acquire($s2);
/*
while( $t1-&gt;isAlive() &amp;&amp; $t2-&gt;isAlive() ) {}//*/
?&gt;</description>
		<content:encoded><![CDATA[<p>what do you think about this solution? (Runs on Linux (slackvare) 2.6.27.7)</p>
<p>PHP 5.2.11 (cli) (built: Oct  2 2009 17:30:20)</p>
<p>&lt;?php<br />
require_once( &#039;Thread.php&#039; );<br />
if ( function_exists(&#039;sem_get&#039;) )echo &quot;sem&quot;;<br />
   // test to see if threading is available<br />
if( ! Thread::available() ) {<br />
        die( &#039;Threads not supported&#039; );<br />
}<br />
// function to be ran on separate threads<br />
function paralel( $_limit, $_name ,$lock) {<br />
        sem_acquire($lock);<br />
        for ( $index = 0; $index start( 10, &#8216;t1&#8242;,$s1);<br />
$s2 = sem_get(2);<br />
$t2-&gt;start( 10, &#8216;t2&#8242;,$s2);<br />
// keep the program running until the threads finish<br />
sem_acquire($s1);<br />
sem_acquire($s2);<br />
/*<br />
while( $t1-&gt;isAlive() &amp;&amp; $t2-&gt;isAlive() ) {}//*/<br />
?&gt;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: anon</title>
		<link>http://blog.motane.lu/2009/01/02/multithreading-in-php/comment-page-2/#comment-3956</link>
		<dc:creator>anon</dc:creator>
		<pubDate>Tue, 17 Jan 2012 04:48:03 +0000</pubDate>
		<guid isPermaLink="false">http://blog.motane.lu/?p=40#comment-3956</guid>
		<description>what just writing a plugin for sonic daemon?</description>
		<content:encoded><![CDATA[<p>what just writing a plugin for sonic daemon?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marian</title>
		<link>http://blog.motane.lu/2009/01/02/multithreading-in-php/comment-page-2/#comment-2779</link>
		<dc:creator>Marian</dc:creator>
		<pubDate>Fri, 09 Dec 2011 16:09:08 +0000</pubDate>
		<guid isPermaLink="false">http://blog.motane.lu/?p=40#comment-2779</guid>
		<description>Why use the loop to keep things alive?
You can just set the time limit to 0 and only when one thread closes you can check if there are any other working if not exit.
I think you might spare some resources.
I am working a lot with socket listeners built in PHP and Python... so they are never supposed to stop and the PHP version works very neat like that using quite few resources.</description>
		<content:encoded><![CDATA[<p>Why use the loop to keep things alive?<br />
You can just set the time limit to 0 and only when one thread closes you can check if there are any other working if not exit.<br />
I think you might spare some resources.<br />
I am working a lot with socket listeners built in PHP and Python&#8230; so they are never supposed to stop and the PHP version works very neat like that using quite few resources.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cosmin</title>
		<link>http://blog.motane.lu/2009/01/02/multithreading-in-php/comment-page-2/#comment-2763</link>
		<dc:creator>Cosmin</dc:creator>
		<pubDate>Thu, 01 Dec 2011 23:04:21 +0000</pubDate>
		<guid isPermaLink="false">http://blog.motane.lu/?p=40#comment-2763</guid>
		<description>My post is about achieving multithreading in general, not on a specific case. Of course, you are limited to the single main thread of PHP but which can spawn multiple child threads by interoping, for example, with .net.

You can think of it like this: PHP thread would pass a list of &quot;operations&quot; to be executed on different threads by .net. Instead of having them waiting one for eachother, they could run in parallel. Of course, you can not overcome the limitation of the PHP thread, but there is still a slight gain on performance.</description>
		<content:encoded><![CDATA[<p>My post is about achieving multithreading in general, not on a specific case. Of course, you are limited to the single main thread of PHP but which can spawn multiple child threads by interoping, for example, with .net.</p>
<p>You can think of it like this: PHP thread would pass a list of &#8220;operations&#8221; to be executed on different threads by .net. Instead of having them waiting one for eachother, they could run in parallel. Of course, you can not overcome the limitation of the PHP thread, but there is still a slight gain on performance.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Suresh</title>
		<link>http://blog.motane.lu/2009/01/02/multithreading-in-php/comment-page-2/#comment-2760</link>
		<dc:creator>Suresh</dc:creator>
		<pubDate>Thu, 01 Dec 2011 06:30:29 +0000</pubDate>
		<guid isPermaLink="false">http://blog.motane.lu/?p=40#comment-2760</guid>
		<description>Hi,
 Thanks for your information

how to use this for search?
search result will execute same window but override previous one</description>
		<content:encoded><![CDATA[<p>Hi,<br />
 Thanks for your information</p>
<p>how to use this for search?<br />
search result will execute same window but override previous one</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cosmin</title>
		<link>http://blog.motane.lu/2009/01/02/multithreading-in-php/comment-page-2/#comment-2758</link>
		<dc:creator>Cosmin</dc:creator>
		<pubDate>Wed, 30 Nov 2011 22:48:36 +0000</pubDate>
		<guid isPermaLink="false">http://blog.motane.lu/?p=40#comment-2758</guid>
		<description>If you are talking about Windows, in most of the cases the discussion involves .NET. Of course..you can achieve multithreading by interoping with Java, C++ etc., but since .NET always come in handy for me, I can recommend you this http://www.facebook.com/note.php?note_id=281965971827784</description>
		<content:encoded><![CDATA[<p>If you are talking about Windows, in most of the cases the discussion involves .NET. Of course..you can achieve multithreading by interoping with Java, C++ etc., but since .NET always come in handy for me, I can recommend you this <a href="http://www.facebook.com/note.php?note_id=281965971827784" rel="nofollow">http://www.facebook.com/note.php?note_id=281965971827784</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Why is realtime apps for php such a problem? - Quora</title>
		<link>http://blog.motane.lu/2009/01/02/multithreading-in-php/comment-page-2/#comment-2723</link>
		<dc:creator>Why is realtime apps for php such a problem? - Quora</dc:creator>
		<pubDate>Fri, 11 Nov 2011 16:54:46 +0000</pubDate>
		<guid isPermaLink="false">http://blog.motane.lu/?p=40#comment-2723</guid>
		<description>[...] level support, there is a guy who created a class which mocks the JAVA Threading here is the link: http://blog.motane.lu/2009/01/02...This answer .Please specify the necessary improvements.&#160;Edit Link Text Show answer summary [...]</description>
		<content:encoded><![CDATA[<p>[...] level support, there is a guy who created a class which mocks the JAVA Threading here is the link: <a href="http://blog.motane.lu/2009/01/02...This" rel="nofollow">http://blog.motane.lu/2009/01/02&#8230;This</a> answer .Please specify the necessary improvements.&nbsp;Edit Link Text Show answer summary [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tudor</title>
		<link>http://blog.motane.lu/2009/01/02/multithreading-in-php/comment-page-2/#comment-2697</link>
		<dc:creator>Tudor</dc:creator>
		<pubDate>Sat, 29 Oct 2011 10:05:08 +0000</pubDate>
		<guid isPermaLink="false">http://blog.motane.lu/?p=40#comment-2697</guid>
		<description>Read the comment above yours...</description>
		<content:encoded><![CDATA[<p>Read the comment above yours&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sa</title>
		<link>http://blog.motane.lu/2009/01/02/multithreading-in-php/comment-page-2/#comment-2696</link>
		<dc:creator>sa</dc:creator>
		<pubDate>Fri, 28 Oct 2011 04:07:49 +0000</pubDate>
		<guid isPermaLink="false">http://blog.motane.lu/?p=40#comment-2696</guid>
		<description>is there a sollution for windows system?</description>
		<content:encoded><![CDATA[<p>is there a sollution for windows system?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

