<?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: Concurrency and HashMap</title>
	<atom:link href="http://blog.webscale.co.in/?feed=rss2&#038;p=25" rel="self" type="application/rss+xml" />
	<link>http://blog.webscale.co.in/?p=25</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Sun, 27 Jun 2010 15:52:43 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Michael B</title>
		<link>http://blog.webscale.co.in/?p=25&#038;cpage=1#comment-62</link>
		<dc:creator>Michael B</dc:creator>
		<pubDate>Tue, 01 Jul 2008 21:49:43 +0000</pubDate>
		<guid isPermaLink="false">http://pitfalls.wordpress.com/?p=25#comment-62</guid>
		<description>&quot;Finally i will leave you with this interesting bug in Java which says HashMap can...&quot;
Wrong choice of words as it&#039;s not a bug. A pitfall for the uninitiated? sure.

not thread-safe means not thread-safe. It&#039;s a visibility issue that is goign to stay in there as it&#039;s outside the scope of what a hashmap is suppose to do, use a ConcurrentMap implementation.

For an other perfect example where ppl also used there &#039;smart creativity&#039; check out:
http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html

dj wrote:
&quot;Nicely written. But I was not able to reproduce it. any clues ?&quot;
Try reading this blog: http://java.dzone.com/articles/but-it-works-on-my-machine
In short the jvm you used might provide more visibility that it has too. The bottom line that which isn&#039;t guaranteed to work is going to bit you in the ass -&gt; small adaptation of murphies law.</description>
		<content:encoded><![CDATA[<p>&#8220;Finally i will leave you with this interesting bug in Java which says HashMap can&#8230;&#8221;<br />
Wrong choice of words as it&#8217;s not a bug. A pitfall for the uninitiated? sure.</p>
<p>not thread-safe means not thread-safe. It&#8217;s a visibility issue that is goign to stay in there as it&#8217;s outside the scope of what a hashmap is suppose to do, use a ConcurrentMap implementation.</p>
<p>For an other perfect example where ppl also used there &#8217;smart creativity&#8217; check out:<br />
<a href="http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html" rel="nofollow">http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html</a></p>
<p>dj wrote:<br />
&#8220;Nicely written. But I was not able to reproduce it. any clues ?&#8221;<br />
Try reading this blog: <a href="http://java.dzone.com/articles/but-it-works-on-my-machine" rel="nofollow">http://java.dzone.com/articles/but-it-works-on-my-machine</a><br />
In short the jvm you used might provide more visibility that it has too. The bottom line that which isn&#8217;t guaranteed to work is going to bit you in the ass -&gt; small adaptation of murphies law.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dj</title>
		<link>http://blog.webscale.co.in/?p=25&#038;cpage=1#comment-61</link>
		<dc:creator>dj</dc:creator>
		<pubDate>Tue, 01 Jul 2008 04:34:56 +0000</pubDate>
		<guid isPermaLink="false">http://pitfalls.wordpress.com/?p=25#comment-61</guid>
		<description>Nicely written. But I was not able to reproduce it. any clues ?</description>
		<content:encoded><![CDATA[<p>Nicely written. But I was not able to reproduce it. any clues ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James</title>
		<link>http://blog.webscale.co.in/?p=25&#038;cpage=1#comment-63</link>
		<dc:creator>James</dc:creator>
		<pubDate>Mon, 30 Jun 2008 06:20:22 +0000</pubDate>
		<guid isPermaLink="false">http://pitfalls.wordpress.com/?p=25#comment-63</guid>
		<description>Nice, well explained article. I think this could do really well on JavaLobby. If you&#039;re interested in reposting there, send me a mail and we can organise it

James</description>
		<content:encoded><![CDATA[<p>Nice, well explained article. I think this could do really well on JavaLobby. If you&#8217;re interested in reposting there, send me a mail and we can organise it</p>
<p>James</p>
]]></content:encoded>
	</item>
</channel>
</rss>
