<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.0.2" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: Hashtable and synchronization</title>
	<link>http://tech.puredanger.com/2008/02/21/hashtable-and-synchronization/</link>
	<description>Alex Miller's technical blog</description>
	<pubDate>Thu, 08 Jan 2009 22:22:26 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.2</generator>

	<item>
		<title>by: Anonymous</title>
		<link>http://tech.puredanger.com/2008/02/21/hashtable-and-synchronization/#comment-32609</link>
		<pubDate>Fri, 14 Mar 2008 20:05:07 +0000</pubDate>
		<guid>http://tech.puredanger.com/2008/02/21/hashtable-and-synchronization/#comment-32609</guid>
					<description>If you dont synchronize your Hashtable or Collections.synchronizedList when you iterate on it, you risk getting an ConcurrentModificationException if another thread mutate the data structure while you perform the iteration. Which I guess is the best case scenario, the worse case is getting corrupted data, such as the same data twice, or missing data.</description>
		<content:encoded><![CDATA[<p>If you dont synchronize your Hashtable or Collections.synchronizedList when you iterate on it, you risk getting an ConcurrentModificationException if another thread mutate the data structure while you perform the iteration. Which I guess is the best case scenario, the worse case is getting corrupted data, such as the same data twice, or missing data.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Robert Konigsberg</title>
		<link>http://tech.puredanger.com/2008/02/21/hashtable-and-synchronization/#comment-28714</link>
		<pubDate>Sat, 23 Feb 2008 07:00:42 +0000</pubDate>
		<guid>http://tech.puredanger.com/2008/02/21/hashtable-and-synchronization/#comment-28714</guid>
					<description>Interestingly, your last example becomes more nefarious when the iterator is implicit, as in:

for (Object o : list) { foo(o); }

Who expected the need for those to be synchronized as well? But I am still unconvinced this is correct. (Not saying you're wrong, I'm just skeptical, and since the source is close by...)</description>
		<content:encoded><![CDATA[<p>Interestingly, your last example becomes more nefarious when the iterator is implicit, as in:</p>
<p>for (Object o : list) { foo(o); }</p>
<p>Who expected the need for those to be synchronized as well? But I am still unconvinced this is correct. (Not saying you&#8217;re wrong, I&#8217;m just skeptical, and since the source is close by&#8230;)
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Alex</title>
		<link>http://tech.puredanger.com/2008/02/21/hashtable-and-synchronization/#comment-28495</link>
		<pubDate>Thu, 21 Feb 2008 13:45:16 +0000</pubDate>
		<guid>http://tech.puredanger.com/2008/02/21/hashtable-and-synchronization/#comment-28495</guid>
					<description>Yes, I would in general agree, although there are some rare cases where I've used the synch wrappers.</description>
		<content:encoded><![CDATA[<p>Yes, I would in general agree, although there are some rare cases where I&#8217;ve used the synch wrappers.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Sam Halliday</title>
		<link>http://tech.puredanger.com/2008/02/21/hashtable-and-synchronization/#comment-28459</link>
		<pubDate>Thu, 21 Feb 2008 09:43:52 +0000</pubDate>
		<guid>http://tech.puredanger.com/2008/02/21/hashtable-and-synchronization/#comment-28459</guid>
					<description>I'd argue that the &lt;code&gt;Collections.synchronized*&lt;/code&gt; methods are only for dealing with legacy code as well... &lt;code&gt;ConcurrentHashMap&lt;/code&gt; is a much more scalable solution.</description>
		<content:encoded><![CDATA[<p>I&#8217;d argue that the <code>Collections.synchronized*</code> methods are only for dealing with legacy code as well&#8230; <code>ConcurrentHashMap</code> is a much more scalable solution.
</p>
]]></content:encoded>
				</item>
</channel>
</rss>
