<?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: Thread coordination with CountDownLatch and CyclicBarrier</title>
	<atom:link href="http://tech.puredanger.com/index.php/2007/11/11/thread-coord/feed/" rel="self" type="application/rss+xml" />
	<link>http://tech.puredanger.com/2007/11/11/thread-coord/</link>
	<description>Alex Miller&#039;s technical blog</description>
	<lastBuildDate>Mon, 06 Feb 2012 19:39:50 -0800</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.4</generator>
	<item>
		<title>By: Confluence: Fritt om fag</title>
		<link>http://tech.puredanger.com/2007/11/11/thread-coord/comment-page-1/#comment-202665</link>
		<dc:creator>Confluence: Fritt om fag</dc:creator>
		<pubDate>Thu, 29 Apr 2010 06:11:42 +0000</pubDate>
		<guid isPermaLink="false">http://tech.puredanger.com/2007/11/11/thread-coord/#comment-202665</guid>
		<description>&lt;strong&gt;Java-tips...&lt;/strong&gt;

Tips om Java Fundamentale teknikker Identitetskrise om identitet i Javaobjekter, inkludert {{equals/hashCode/Comparable}} Eksepsjonell kode om exceptions Om serialisering...</description>
		<content:encoded><![CDATA[<p><strong>Java-tips&#8230;</strong></p>
<p>Tips om Java Fundamentale teknikker Identitetskrise om identitet i Javaobjekter, inkludert {{equals/hashCode/Comparable}} Eksepsjonell kode om exceptions Om serialisering&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ashley Williams</title>
		<link>http://tech.puredanger.com/2007/11/11/thread-coord/comment-page-1/#comment-171218</link>
		<dc:creator>Ashley Williams</dc:creator>
		<pubDate>Wed, 22 Jul 2009 08:26:36 +0000</pubDate>
		<guid isPermaLink="false">http://tech.puredanger.com/2007/11/11/thread-coord/#comment-171218</guid>
		<description>Let me qualify that a little: in a real world project the thread allocation policy and the task logic might not nicely be co-located in the same file. Then a developer might come along and swap the fixed thread executor to one with fewer threads as we are encouraged to do with the executor framework, without realizing the impact until the application freezes.

I take your point that with discipline this wouldn&#039;t happen, just checking my understanding of cyclic barriers really.

Great concurrency refcard b.t.w.</description>
		<content:encoded><![CDATA[<p>Let me qualify that a little: in a real world project the thread allocation policy and the task logic might not nicely be co-located in the same file. Then a developer might come along and swap the fixed thread executor to one with fewer threads as we are encouraged to do with the executor framework, without realizing the impact until the application freezes.</p>
<p>I take your point that with discipline this wouldn&#8217;t happen, just checking my understanding of cyclic barriers really.</p>
<p>Great concurrency refcard b.t.w.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://tech.puredanger.com/2007/11/11/thread-coord/comment-page-1/#comment-171134</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Tue, 21 Jul 2009 16:38:29 +0000</pubDate>
		<guid isPermaLink="false">http://tech.puredanger.com/2007/11/11/thread-coord/#comment-171134</guid>
		<description>I don&#039;t know if I&#039;d say it was dangerous. You&#039;re correct that the thread count and barrier participants must be linked but as long as that invariant is maintained I think it&#039;s fine.  

This is kind of a common problem with barriers in that the participant count must be a) known in advance and b) fixed.  The new Phaser class being added in JDK 7 is more flexible in this regard as the participant count can change during the life of the phaser.</description>
		<content:encoded><![CDATA[<p>I don&#8217;t know if I&#8217;d say it was dangerous. You&#8217;re correct that the thread count and barrier participants must be linked but as long as that invariant is maintained I think it&#8217;s fine.  </p>
<p>This is kind of a common problem with barriers in that the participant count must be a) known in advance and b) fixed.  The new Phaser class being added in JDK 7 is more flexible in this regard as the participant count can change during the life of the phaser.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ashley Williams</title>
		<link>http://tech.puredanger.com/2007/11/11/thread-coord/comment-page-1/#comment-171131</link>
		<dc:creator>Ashley Williams</dc:creator>
		<pubDate>Tue, 21 Jul 2009 16:20:46 +0000</pubDate>
		<guid isPermaLink="false">http://tech.puredanger.com/2007/11/11/thread-coord/#comment-171131</guid>
		<description>Isn&#039;t it a little dangerous to mix the barrier with the executor in this way? If you were to change the execution policy so that for example fewer threads were used then the threads won&#039;t get released.

So it looks like the tasks and the execution policy are coupled tightly to the thread count.</description>
		<content:encoded><![CDATA[<p>Isn&#8217;t it a little dangerous to mix the barrier with the executor in this way? If you were to change the execution policy so that for example fewer threads were used then the threads won&#8217;t get released.</p>
<p>So it looks like the tasks and the execution policy are coupled tightly to the thread count.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rishabh</title>
		<link>http://tech.puredanger.com/2007/11/11/thread-coord/comment-page-1/#comment-154190</link>
		<dc:creator>Rishabh</dc:creator>
		<pubDate>Mon, 23 Mar 2009 03:54:45 +0000</pubDate>
		<guid isPermaLink="false">http://tech.puredanger.com/2007/11/11/thread-coord/#comment-154190</guid>
		<description>nice article.
However i&#039;d like to point out that the best use of cyclicbarrier is when a few threads want to wait for each other to reach a certain point. Bear in mind that the parent thread does not stop for the child threads unless u barrier.await();  on threads+1.
 
If u want that the parent thread should wait for the children then countdownlatch is the way to go. You can create a latch with the number_of_threads and then each thread can just countDown(); and the parent can await() on the same latch.</description>
		<content:encoded><![CDATA[<p>nice article.<br />
However i&#8217;d like to point out that the best use of cyclicbarrier is when a few threads want to wait for each other to reach a certain point. Bear in mind that the parent thread does not stop for the child threads unless u barrier.await();  on threads+1.</p>
<p>If u want that the parent thread should wait for the children then countdownlatch is the way to go. You can create a latch with the number_of_threads and then each thread can just countDown(); and the parent can await() on the same latch.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

