<?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: Software Transactional Memory in Scala</title>
	<atom:link href="http://www.codecommit.com/blog/scala/software-transactional-memory-in-scala/feed" rel="self" type="application/rss+xml" />
	<link>http://www.codecommit.com/blog/scala/software-transactional-memory-in-scala</link>
	<description>(permanently in beta)</description>
	<lastBuildDate>Sun, 29 Aug 2010 20:01:44 -0700</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Guus Bloemsma</title>
		<link>http://www.codecommit.com/blog/scala/software-transactional-memory-in-scala/comment-page-1#comment-5108</link>
		<dc:creator>Guus Bloemsma</dc:creator>
		<pubDate>Sat, 17 Jul 2010 15:16:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.codecommit.com/blog/scala/software-transactional-memory-in-scala#comment-5108</guid>
		<description>In paragraph &quot;Atomic 2.0&quot;, step 5 of the scenario, the implementation could detect that reference B has a value newer than the start of transaction B and throw a specific exception. This is the exact same check as the one that catches the problem at commit time.

Failing faster might even improve performance a little bit to offset the loss of performance because of checking more often.</description>
		<content:encoded><![CDATA[<p>In paragraph &#8220;Atomic 2.0&#8243;, step 5 of the scenario, the implementation could detect that reference B has a value newer than the start of transaction B and throw a specific exception. This is the exact same check as the one that catches the problem at commit time.</p>
<p>Failing faster might even improve performance a little bit to offset the loss of performance because of checking more often.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris</title>
		<link>http://www.codecommit.com/blog/scala/software-transactional-memory-in-scala/comment-page-1#comment-4928</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Sat, 30 Jan 2010 21:43:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.codecommit.com/blog/scala/software-transactional-memory-in-scala#comment-4928</guid>
		<description>Downloaded your code samples, but it was missing the package...
   com.codecommit.collection</description>
		<content:encoded><![CDATA[<p>Downloaded your code samples, but it was missing the package&#8230;<br />
   com.codecommit.collection</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark Volkmann</title>
		<link>http://www.codecommit.com/blog/scala/software-transactional-memory-in-scala/comment-page-1#comment-4889</link>
		<dc:creator>Mark Volkmann</dc:creator>
		<pubDate>Tue, 01 Sep 2009 00:55:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.codecommit.com/blog/scala/software-transactional-memory-in-scala#comment-4889</guid>
		<description>For comprehensive details on how STM is implemented in Clojure, see http://ociweb.com/mark/stm/article.html.</description>
		<content:encoded><![CDATA[<p>For comprehensive details on how STM is implemented in Clojure, see <a href="http://ociweb.com/mark/stm/article.html" rel="nofollow">http://ociweb.com/mark/stm/article.html</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gilles</title>
		<link>http://www.codecommit.com/blog/scala/software-transactional-memory-in-scala/comment-page-1#comment-4713</link>
		<dc:creator>Gilles</dc:creator>
		<pubDate>Wed, 11 Feb 2009 14:43:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.codecommit.com/blog/scala/software-transactional-memory-in-scala#comment-4713</guid>
		<description>Wouldn&#039;t this atomic transaction nesting be possible just by using a tree instead of an integer for versioning?</description>
		<content:encoded><![CDATA[<p>Wouldn&#8217;t this atomic transaction nesting be possible just by using a tree instead of an integer for versioning?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel</title>
		<link>http://www.codecommit.com/blog/scala/software-transactional-memory-in-scala/comment-page-1#comment-4462</link>
		<dc:creator>Daniel</dc:creator>
		<pubDate>Thu, 08 Jan 2009 20:21:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.codecommit.com/blog/scala/software-transactional-memory-in-scala#comment-4462</guid>
		<description>I&#039;m sure many will disagree with the following, but...

The WHOLE point of STM is enabling nesting of atomic transactions. It is only in this respect that STM is superior to other concurrency control structures.

What STM does is solve the composability problem. Specifically, during a transaction I can use outside code (such as libraries) which, in turn, require transactions, without being vulnerable to lock order issues (which lead to live locks and dead locks). But that&#039;s only true, of course, if you can nest STM transactions.

If that&#039;s not true, then you don&#039;t have STM, you have something that looks like STM. See Composable Operations in the link you got your syntax from.</description>
		<content:encoded><![CDATA[<p>I&#8217;m sure many will disagree with the following, but&#8230;</p>
<p>The WHOLE point of STM is enabling nesting of atomic transactions. It is only in this respect that STM is superior to other concurrency control structures.</p>
<p>What STM does is solve the composability problem. Specifically, during a transaction I can use outside code (such as libraries) which, in turn, require transactions, without being vulnerable to lock order issues (which lead to live locks and dead locks). But that&#8217;s only true, of course, if you can nest STM transactions.</p>
<p>If that&#8217;s not true, then you don&#8217;t have STM, you have something that looks like STM. See Composable Operations in the link you got your syntax from.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Spiewak</title>
		<link>http://www.codecommit.com/blog/scala/software-transactional-memory-in-scala/comment-page-1#comment-4152</link>
		<dc:creator>Daniel Spiewak</dc:creator>
		<pubDate>Mon, 20 Oct 2008 01:06:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.codecommit.com/blog/scala/software-transactional-memory-in-scala#comment-4152</guid>
		<description>@Ian

It&#039;s hard to say.  :-)  I didn&#039;t do any serious testing, but it&#039;s a simple enough library that you shouldn&#039;t have many problems.  The source is all BSD licensed (except for Vector, which is CPL), so you&#039;re more than free to take it and do what you will.</description>
		<content:encoded><![CDATA[<p>@Ian</p>
<p>It&#8217;s hard to say.  <img src='http://www.codecommit.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />   I didn&#8217;t do any serious testing, but it&#8217;s a simple enough library that you shouldn&#8217;t have many problems.  The source is all BSD licensed (except for Vector, which is CPL), so you&#8217;re more than free to take it and do what you will.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ian Clarke</title>
		<link>http://www.codecommit.com/blog/scala/software-transactional-memory-in-scala/comment-page-1#comment-4151</link>
		<dc:creator>Ian Clarke</dc:creator>
		<pubDate>Sun, 19 Oct 2008 23:30:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.codecommit.com/blog/scala/software-transactional-memory-in-scala#comment-4151</guid>
		<description>Very interesting.  Is the code for this library in a sufficiently stable/robust state for third-party use?</description>
		<content:encoded><![CDATA[<p>Very interesting.  Is the code for this library in a sufficiently stable/robust state for third-party use?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Patrick Wright</title>
		<link>http://www.codecommit.com/blog/scala/software-transactional-memory-in-scala/comment-page-1#comment-4113</link>
		<dc:creator>Patrick Wright</dc:creator>
		<pubDate>Thu, 09 Oct 2008 06:09:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.codecommit.com/blog/scala/software-transactional-memory-in-scala#comment-4113</guid>
		<description>FYI, there&#039;s an interesting discussion on STMs in Haskell, Clojure, and Java (JVSTM) over at http://blogs.azulsystems.com/cliff/2008/05/clojure-stms-vs.html.


Cheers
Patrick</description>
		<content:encoded><![CDATA[<p>FYI, there&#8217;s an interesting discussion on STMs in Haskell, Clojure, and Java (JVSTM) over at <a href="http://blogs.azulsystems.com/cliff/2008/05/clojure-stms-vs.html" rel="nofollow">http://blogs.azulsystems.com/cliff/2008/05/clojure-stms-vs.html</a>.</p>
<p>Cheers<br />
Patrick</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Spiewak</title>
		<link>http://www.codecommit.com/blog/scala/software-transactional-memory-in-scala/comment-page-1#comment-4106</link>
		<dc:creator>Daniel Spiewak</dc:creator>
		<pubDate>Tue, 07 Oct 2008 16:52:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.codecommit.com/blog/scala/software-transactional-memory-in-scala#comment-4106</guid>
		<description>@James

I really like the monadic approach to STM as it is implemented in GHC Haskell.  It&#039;s unfortunate that Scala&#039;s for-comprehensions are so much more verbose than Haskell&#039;s.  It was partially for this reason that I ruled out monads fairly early in my design process.

The implicits actually came out of an attempt to make the explicit API (your first design) a little less verbose.  After some more thought, it occurred to me that I could use scoping rules to favor one transaction type over another, and the rest just fell into place.

@Asd

&gt; 1. Oracle transactions do not work like that. 

I never said they did, I was only attempting to point out that databases have been using transactions for a very long time.

&gt; 2. Read outside a transaction is a big hole that’ll let people make mistakes

Weak transactional semantics are a certainly a point of contention.  It is a whole which allows potentially inconsistent state between reads, but it is assumed that users of the API will be aware of this and the tradeoffs.  If you need integrity in the reads, move them into a transaction and return an atomic aggregate result.

It would be possible to provide two different types of refs, one with strong and the other with weak semantics.  There&#039;s nothing really in the design of this STM library which would forbid such an approach, I just didn&#039;t take it.

&gt; 3. It is not necessarily easier to get transaction right than it is to get locks right. Every update might be in a transaction, but it might be the wrong transaction

I&#039;m not sure what you mean by &quot;the wrong transaction&quot;.  As a general rule, if you put some operation in a transaction, it is *guaranteed* to both maintain and operate on fully-consistent data.  It doesn&#039;t actually matter which transaction the operations are distributed across.  It is true that you may be able to derive a pathological distribution of tasks which leads to trouble due to concurrent ordering of mutually dependent operations, but that would certainly be a contrived case.  Even in such a scenario, the data itself would remain consistent with respect to the operations, the final results would simply be indeterminate.

&gt; 4. Nested atomic ops = uh-oh

Some STM systems actually allow nested atomic ops without any problems at all.  You are correct in pointing out that with the STM designed here, we would run into problems.  However, I&#039;m sure that with a little thought, it would be possible to statically restrict the `atomic` method to only operate outside of a transaction.</description>
		<content:encoded><![CDATA[<p>@James</p>
<p>I really like the monadic approach to STM as it is implemented in GHC Haskell.  It&#8217;s unfortunate that Scala&#8217;s for-comprehensions are so much more verbose than Haskell&#8217;s.  It was partially for this reason that I ruled out monads fairly early in my design process.</p>
<p>The implicits actually came out of an attempt to make the explicit API (your first design) a little less verbose.  After some more thought, it occurred to me that I could use scoping rules to favor one transaction type over another, and the rest just fell into place.</p>
<p>@Asd</p>
<p>&gt; 1. Oracle transactions do not work like that. </p>
<p>I never said they did, I was only attempting to point out that databases have been using transactions for a very long time.</p>
<p>&gt; 2. Read outside a transaction is a big hole that’ll let people make mistakes</p>
<p>Weak transactional semantics are a certainly a point of contention.  It is a whole which allows potentially inconsistent state between reads, but it is assumed that users of the API will be aware of this and the tradeoffs.  If you need integrity in the reads, move them into a transaction and return an atomic aggregate result.</p>
<p>It would be possible to provide two different types of refs, one with strong and the other with weak semantics.  There&#8217;s nothing really in the design of this STM library which would forbid such an approach, I just didn&#8217;t take it.</p>
<p>&gt; 3. It is not necessarily easier to get transaction right than it is to get locks right. Every update might be in a transaction, but it might be the wrong transaction</p>
<p>I&#8217;m not sure what you mean by &#8220;the wrong transaction&#8221;.  As a general rule, if you put some operation in a transaction, it is *guaranteed* to both maintain and operate on fully-consistent data.  It doesn&#8217;t actually matter which transaction the operations are distributed across.  It is true that you may be able to derive a pathological distribution of tasks which leads to trouble due to concurrent ordering of mutually dependent operations, but that would certainly be a contrived case.  Even in such a scenario, the data itself would remain consistent with respect to the operations, the final results would simply be indeterminate.</p>
<p>&gt; 4. Nested atomic ops = uh-oh</p>
<p>Some STM systems actually allow nested atomic ops without any problems at all.  You are correct in pointing out that with the STM designed here, we would run into problems.  However, I&#8217;m sure that with a little thought, it would be possible to statically restrict the `atomic` method to only operate outside of a transaction.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Asd</title>
		<link>http://www.codecommit.com/blog/scala/software-transactional-memory-in-scala/comment-page-1#comment-4105</link>
		<dc:creator>Asd</dc:creator>
		<pubDate>Tue, 07 Oct 2008 15:27:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.codecommit.com/blog/scala/software-transactional-memory-in-scala#comment-4105</guid>
		<description>1. Oracle transactions do not work like that. 

2. Read outside a transaction is a big hole that&#039;ll let people make mistakes

3. It is not necessarily easier to get transaction right than it is to get locks right. Every update might be in a transaction, but it might be the wrong transaction

4. Nested atomic ops = uh-oh</description>
		<content:encoded><![CDATA[<p>1. Oracle transactions do not work like that. </p>
<p>2. Read outside a transaction is a big hole that&#8217;ll let people make mistakes</p>
<p>3. It is not necessarily easier to get transaction right than it is to get locks right. Every update might be in a transaction, but it might be the wrong transaction</p>
<p>4. Nested atomic ops = uh-oh</p>
]]></content:encoded>
	</item>
</channel>
</rss>
