<?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: Enumerate Collections without Exceptions</title>
	<atom:link href="http://www.csharp411.com/enumerate-collections-without-exceptions/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.csharp411.com/enumerate-collections-without-exceptions/</link>
	<description>C# Development</description>
	<lastBuildDate>Fri, 03 Feb 2012 11:14:43 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: timm</title>
		<link>http://www.csharp411.com/enumerate-collections-without-exceptions/#comment-643</link>
		<dc:creator>timm</dc:creator>
		<pubDate>Tue, 06 May 2008 15:25:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.csharp411.com/enumerate-collections-without-exceptions/#comment-643</guid>
		<description>Excellent question.  If the array is synchronized, then yes, ToArray is thread-safe, as shown in Reflector:

public override object[] ToArray()
{
    lock (this._root)
    {
        return this._list.ToArray();
    }
}

But if not using a synchronized ArrayList, then you might want to explicitly lock the SyncRoot, similar to approach #1.</description>
		<content:encoded><![CDATA[<p>Excellent question.  If the array is synchronized, then yes, ToArray is thread-safe, as shown in Reflector:</p>
<p>public override object[] ToArray()<br />
{<br />
    lock (this._root)<br />
    {<br />
        return this._list.ToArray();<br />
    }<br />
}</p>
<p>But if not using a synchronized ArrayList, then you might want to explicitly lock the SyncRoot, similar to approach #1.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike</title>
		<link>http://www.csharp411.com/enumerate-collections-without-exceptions/#comment-642</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Tue, 06 May 2008 15:03:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.csharp411.com/enumerate-collections-without-exceptions/#comment-642</guid>
		<description>Is the &quot;ToArray&quot; method thread safe?</description>
		<content:encoded><![CDATA[<p>Is the &#8220;ToArray&#8221; method thread safe?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

