<?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: More fun with Java Concurrency: BlockingQueue</title>
	<atom:link href="http://blog.carbonfive.com/2009/02/java/more-fun-with-java-concurrency-blockingqueue/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.carbonfive.com/2009/02/java/more-fun-with-java-concurrency-blockingqueue</link>
	<description></description>
	<lastBuildDate>Fri, 12 Mar 2010 00:31:40 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Effective using Java Concurrency part-3 &#171; When IE meets SE&#8230;</title>
		<link>http://blog.carbonfive.com/2009/02/java/more-fun-with-java-concurrency-blockingqueue/comment-page-1#comment-1073</link>
		<dc:creator>Effective using Java Concurrency part-3 &#171; When IE meets SE&#8230;</dc:creator>
		<pubDate>Mon, 10 Aug 2009 07:46:43 +0000</pubDate>
		<guid isPermaLink="false">http://blog.carbonfive.com/?p=308#comment-1073</guid>
		<description>[...] JDK API 1.2 Java 5&#8217;s BlockingQueue 1.3 More fun with Java Concurrency: BlockingQueue 1.4 Which Java blocking queue is most efficient for single-producer single-consumer scenarios 1.5 [...]</description>
		<content:encoded><![CDATA[<p>[...] JDK API 1.2 Java 5&#8217;s BlockingQueue 1.3 More fun with Java Concurrency: BlockingQueue 1.4 Which Java blocking queue is most efficient for single-producer single-consumer scenarios 1.5 [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: deadlock</title>
		<link>http://blog.carbonfive.com/2009/02/java/more-fun-with-java-concurrency-blockingqueue/comment-page-1#comment-301</link>
		<dc:creator>deadlock</dc:creator>
		<pubDate>Thu, 12 Mar 2009 16:19:00 +0000</pubDate>
		<guid isPermaLink="false">http://blog.carbonfive.com/?p=308#comment-301</guid>
		<description>Think about the case: 
1. parse put the last one to the queue
2. Persister take the last one from the queue
3. Persister go around the while loop, and executing queue.take() again (NOTE, one this time, done=false, and the Persister will wait ...)
4. parse set done to true

The persister will wait along. You&#039;d better use a mark Object as the last element in the queue.</description>
		<content:encoded><![CDATA[<p>Think about the case:<br />
1. parse put the last one to the queue<br />
2. Persister take the last one from the queue<br />
3. Persister go around the while loop, and executing queue.take() again (NOTE, one this time, done=false, and the Persister will wait &#8230;)<br />
4. parse set done to true</p>
<p>The persister will wait along. You&#8217;d better use a mark Object as the last element in the queue.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: christian</title>
		<link>http://blog.carbonfive.com/2009/02/java/more-fun-with-java-concurrency-blockingqueue/comment-page-1#comment-300</link>
		<dc:creator>christian</dc:creator>
		<pubDate>Thu, 12 Mar 2009 16:03:30 +0000</pubDate>
		<guid isPermaLink="false">http://blog.carbonfive.com/?p=308#comment-300</guid>
		<description>@Alex: thanks for spotting the &gt; 0 typo... it&#039;s been fixed.</description>
		<content:encoded><![CDATA[<p>@Alex: thanks for spotting the &gt; 0 typo&#8230; it&#8217;s been fixed.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://blog.carbonfive.com/2009/02/java/more-fun-with-java-concurrency-blockingqueue/comment-page-1#comment-297</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Thu, 12 Mar 2009 07:56:41 +0000</pubDate>
		<guid isPermaLink="false">http://blog.carbonfive.com/?p=308#comment-297</guid>
		<description>Agree about volatile boolean done.
Also &quot;if (!entities.isEmpty() &gt; 0)&quot; is not readable code :)</description>
		<content:encoded><![CDATA[<p>Agree about volatile boolean done.<br />
Also &#8220;if (!entities.isEmpty() &gt; 0)&#8221; is not readable code <img src='http://blog.carbonfive.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ruben</title>
		<link>http://blog.carbonfive.com/2009/02/java/more-fun-with-java-concurrency-blockingqueue/comment-page-1#comment-271</link>
		<dc:creator>ruben</dc:creator>
		<pubDate>Wed, 04 Mar 2009 15:33:59 +0000</pubDate>
		<guid isPermaLink="false">http://blog.carbonfive.com/?p=308#comment-271</guid>
		<description>Making done volatile will do too.</description>
		<content:encoded><![CDATA[<p>Making done volatile will do too.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ben</title>
		<link>http://blog.carbonfive.com/2009/02/java/more-fun-with-java-concurrency-blockingqueue/comment-page-1#comment-239</link>
		<dc:creator>Ben</dc:creator>
		<pubDate>Wed, 25 Feb 2009 09:03:07 +0000</pubDate>
		<guid isPermaLink="false">http://blog.carbonfive.com/?p=308#comment-239</guid>
		<description>The JMM makes no guaranty that the update to &quot;done&quot; will be visible. Due to a race you might block forever waiting for new work.

Executors#callable() wraps a Runnable as a Callable.</description>
		<content:encoded><![CDATA[<p>The JMM makes no guaranty that the update to &#8220;done&#8221; will be visible. Due to a race you might block forever waiting for new work.</p>
<p>Executors#callable() wraps a Runnable as a Callable.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: christian</title>
		<link>http://blog.carbonfive.com/2009/02/java/more-fun-with-java-concurrency-blockingqueue/comment-page-1#comment-238</link>
		<dc:creator>christian</dc:creator>
		<pubDate>Wed, 25 Feb 2009 05:52:51 +0000</pubDate>
		<guid isPermaLink="false">http://blog.carbonfive.com/?p=308#comment-238</guid>
		<description>@Marcin I agree that both threads are interacting with the boolean &quot;done&quot;, I don&#039;t see how an issue might arise over its state.  What exactly is the problem you&#039;re seeing?</description>
		<content:encoded><![CDATA[<p>@Marcin I agree that both threads are interacting with the boolean &#8220;done&#8221;, I don&#8217;t see how an issue might arise over its state.  What exactly is the problem you&#8217;re seeing?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: christian</title>
		<link>http://blog.carbonfive.com/2009/02/java/more-fun-with-java-concurrency-blockingqueue/comment-page-1#comment-237</link>
		<dc:creator>christian</dc:creator>
		<pubDate>Wed, 25 Feb 2009 05:48:58 +0000</pubDate>
		<guid isPermaLink="false">http://blog.carbonfive.com/?p=308#comment-237</guid>
		<description>@Nick Look at the API for ExecutorService, it takes Callable (not Runnable).  Do you have a workaround?</description>
		<content:encoded><![CDATA[<p>@Nick Look at the API for ExecutorService, it takes Callable (not Runnable).  Do you have a workaround?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: More fun with Java Concurrency: BlockingQueue &#171; Nexsoft&#8217;s Blog</title>
		<link>http://blog.carbonfive.com/2009/02/java/more-fun-with-java-concurrency-blockingqueue/comment-page-1#comment-236</link>
		<dc:creator>More fun with Java Concurrency: BlockingQueue &#171; Nexsoft&#8217;s Blog</dc:creator>
		<pubDate>Tue, 24 Feb 2009 21:45:31 +0000</pubDate>
		<guid isPermaLink="false">http://blog.carbonfive.com/?p=308#comment-236</guid>
		<description>[...] More fun with Java Concurrency: BlockingQueue Published by christian  on February 23, 2009 in Java [...]</description>
		<content:encoded><![CDATA[<p>[...] More fun with Java Concurrency: BlockingQueue Published by christian  on February 23, 2009 in Java [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nick</title>
		<link>http://blog.carbonfive.com/2009/02/java/more-fun-with-java-concurrency-blockingqueue/comment-page-1#comment-235</link>
		<dc:creator>Nick</dc:creator>
		<pubDate>Tue, 24 Feb 2009 20:11:44 +0000</pubDate>
		<guid isPermaLink="false">http://blog.carbonfive.com/?p=308#comment-235</guid>
		<description>Why to implement Callable if no value is actually calculated and returned?

Why not to use java.util.Iterator instead of Parser (and automatically clean up instead of explicitly exposing the close() method)?</description>
		<content:encoded><![CDATA[<p>Why to implement Callable if no value is actually calculated and returned?</p>
<p>Why not to use java.util.Iterator instead of Parser (and automatically clean up instead of explicitly exposing the close() method)?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marcin Dabrowski</title>
		<link>http://blog.carbonfive.com/2009/02/java/more-fun-with-java-concurrency-blockingqueue/comment-page-1#comment-234</link>
		<dc:creator>Marcin Dabrowski</dc:creator>
		<pubDate>Tue, 24 Feb 2009 19:37:02 +0000</pubDate>
		<guid isPermaLink="false">http://blog.carbonfive.com/?p=308#comment-234</guid>
		<description>It is very interesting example, but maybe you should consider of using AtomicBoolean as done type to create fully thread safe example.</description>
		<content:encoded><![CDATA[<p>It is very interesting example, but maybe you should consider of using AtomicBoolean as done type to create fully thread safe example.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ben</title>
		<link>http://blog.carbonfive.com/2009/02/java/more-fun-with-java-concurrency-blockingqueue/comment-page-1#comment-233</link>
		<dc:creator>Ben</dc:creator>
		<pubDate>Tue, 24 Feb 2009 17:10:48 +0000</pubDate>
		<guid isPermaLink="false">http://blog.carbonfive.com/?p=308#comment-233</guid>
		<description>I believe that you could have simplified this code by allowing the executor&#039;s internal blocking queue manage the work queue. The parser would submit a batch into the executor, rather than one-by-one, wrapped by the task. That would probably drop the code size down by a third, without losing anything performance-wise.</description>
		<content:encoded><![CDATA[<p>I believe that you could have simplified this code by allowing the executor&#8217;s internal blocking queue manage the work queue. The parser would submit a batch into the executor, rather than one-by-one, wrapped by the task. That would probably drop the code size down by a third, without losing anything performance-wise.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
