<?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: Why is LinkedList.clear() linear?</title>
	<atom:link href="http://www.potentialgames.com/blog/2009/05/29/why-is-linkedlistclear-linear/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.potentialgames.com/blog/2009/05/29/why-is-linkedlistclear-linear/</link>
	<description>Notes of a Potential Independent Game Developer</description>
	<lastBuildDate>Sat, 01 May 2010 13:27:33 -0400</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: neb</title>
		<link>http://www.potentialgames.com/blog/2009/05/29/why-is-linkedlistclear-linear/comment-page-1/#comment-3646</link>
		<dc:creator>neb</dc:creator>
		<pubDate>Fri, 29 May 2009 19:09:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.potentialgames.com/blog/?p=420#comment-3646</guid>
		<description>Very well, I accept. Or were you not actually offering me one? Perhaps trying to justify yours? &lt;a href=&quot;http://www.potentialgames.com/blog/about/&quot; rel=&quot;nofollow&quot;&gt;If you really think it will help...&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>Very well, I accept. Or were you not actually offering me one? Perhaps trying to justify yours? <a href="http://www.potentialgames.com/blog/about/" rel="nofollow">If you really think it will help&#8230;</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan</title>
		<link>http://www.potentialgames.com/blog/2009/05/29/why-is-linkedlistclear-linear/comment-page-1/#comment-3645</link>
		<dc:creator>Dan</dc:creator>
		<pubDate>Fri, 29 May 2009 18:55:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.potentialgames.com/blog/?p=420#comment-3645</guid>
		<description>You know, if you got an Amazon Kindle, you could have a newspaper delivered wirelessly and ready for you in the morning.</description>
		<content:encoded><![CDATA[<p>You know, if you got an Amazon Kindle, you could have a newspaper delivered wirelessly and ready for you in the morning.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: neb</title>
		<link>http://www.potentialgames.com/blog/2009/05/29/why-is-linkedlistclear-linear/comment-page-1/#comment-3643</link>
		<dc:creator>neb</dc:creator>
		<pubDate>Fri, 29 May 2009 17:54:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.potentialgames.com/blog/?p=420#comment-3643</guid>
		<description>Good explanation, but yipes. I incorrectly speculated that, in any sane universe, a linked list&#039;s node structure would be kept private. Now I see why they&#039;re stuck with this design.

It&#039;s also sketchy that alternate views on the list (iterators and such) would rely on node unlinking to fail-fast. Instead of relying on this side-effect behavior, sub-views on the list should be checking the modification count.

Just another case of my speculations being entirely correct, and the universe utterly failing to follow through.</description>
		<content:encoded><![CDATA[<p>Good explanation, but yipes. I incorrectly speculated that, in any sane universe, a linked list&#8217;s node structure would be kept private. Now I see why they&#8217;re stuck with this design.</p>
<p>It&#8217;s also sketchy that alternate views on the list (iterators and such) would rely on node unlinking to fail-fast. Instead of relying on this side-effect behavior, sub-views on the list should be checking the modification count.</p>
<p>Just another case of my speculations being entirely correct, and the universe utterly failing to follow through.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Todd</title>
		<link>http://www.potentialgames.com/blog/2009/05/29/why-is-linkedlistclear-linear/comment-page-1/#comment-3641</link>
		<dc:creator>Todd</dc:creator>
		<pubDate>Fri, 29 May 2009 17:29:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.potentialgames.com/blog/?p=420#comment-3641</guid>
		<description>From &lt;a href=&quot;http://stackoverflow.com/questions/575995/clear-impl-in-javas-linkedlist/575998&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;:

&lt;blockquote&gt;
Their method ensures that even if other code still holds references to particular nodes, the other nodes will be GC&#039;ed.

Otherwise, even a single external reference to one of the nodes would prevent the entire chain from being collected.

Also, other operations in the list might be going on simultaneously (e.g. views through subList() or Collections.unmodifiableList(), iterators), and this ensures that those things perceive the list as &quot;empty&quot; immediately.&lt;/blockquote&gt;

In other words, there are ways to get references to the nodes in the list.  Without breaking all of the links, an external reference to a node in the LinkedList would prevent GC of all of the nodes.</description>
		<content:encoded><![CDATA[<p>From <a href="http://stackoverflow.com/questions/575995/clear-impl-in-javas-linkedlist/575998" rel="nofollow">here</a>:</p>
<blockquote><p>
Their method ensures that even if other code still holds references to particular nodes, the other nodes will be GC&#8217;ed.</p>
<p>Otherwise, even a single external reference to one of the nodes would prevent the entire chain from being collected.</p>
<p>Also, other operations in the list might be going on simultaneously (e.g. views through subList() or Collections.unmodifiableList(), iterators), and this ensures that those things perceive the list as &#8220;empty&#8221; immediately.</p></blockquote>
<p>In other words, there are ways to get references to the nodes in the list.  Without breaking all of the links, an external reference to a node in the LinkedList would prevent GC of all of the nodes.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
