<?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 the restriction on local variable capture?</title>
	<atom:link href="https://www.lambdafaq.org/what-are-the-reasons-for-the-restriction-to-effective-immutability/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.lambdafaq.org/what-are-the-reasons-for-the-restriction-to-effective-immutability/</link>
	<description>Your questions answered: all about Lambdas and friends</description>
	<lastBuildDate>Wed, 23 Sep 2020 15:06:58 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.2.38</generator>
	<item>
		<title>By: naftalin</title>
		<link>https://www.lambdafaq.org/what-are-the-reasons-for-the-restriction-to-effective-immutability/#comment-17214</link>
		<dc:creator><![CDATA[naftalin]]></dc:creator>
		<pubDate>Fri, 15 Mar 2013 12:32:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.lambdafaq.org/?p=79#comment-17214</guid>
		<description><![CDATA[They may not want to have race conditions affecting local variables, but if they provide concurrent write access to them from different threads, that&#039;s exactly what they will get unless the programmer ensures mutual exclusion.  But if she does that, then she will lose the performance advantage of multithreading through lock contention.

The language designers considered this issue seriously — to the point of canvassing widely for use cases — and concluded that in almost all the situations in which people want to mutate local variables, there are better solutions using parallel-friendly idioms (ie variants of map-reduce).

Here&#039;s a &lt;a href=&quot;http://www.ibm.com/developerworks/java/library/j-ldn2/index.html&quot; rel=&quot;nofollow&quot;&gt;fuller explanation&lt;/a&gt; of the rationale for this decision.]]></description>
		<content:encoded><![CDATA[<p>They may not want to have race conditions affecting local variables, but if they provide concurrent write access to them from different threads, that&#8217;s exactly what they will get unless the programmer ensures mutual exclusion.  But if she does that, then she will lose the performance advantage of multithreading through lock contention.</p>
<p>The language designers considered this issue seriously — to the point of canvassing widely for use cases — and concluded that in almost all the situations in which people want to mutate local variables, there are better solutions using parallel-friendly idioms (ie variants of map-reduce).</p>
<p>Here&#8217;s a <a href="http://www.ibm.com/developerworks/java/library/j-ldn2/index.html" rel="nofollow">fuller explanation</a> of the rationale for this decision.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
