The latest release of ScalaSTM is version 0.7. To get it you can
- follow sbt instructions or maven2 instructions
- download a prebuilt JAR
Changes between 0.7 and 0.8:
- correctness fix for TArray[Long] and AtomicArray.ofLong.
- small improvement to TxnLocal interface.
- add 2.12 build and remove 2.10 build.
- add deprecated message about incomplete deadlock detection for CommitBarrier.
Changes between 0.6 and 0.7:
- better support for interactive debuggers, via
atomic.unrecorded. IntelliJ IDEA and Eclipse can now watch
Refvalues inside a transaction without affecting the read or write sets.
- ScalaSTM cooperates with 2.10’s
TxnLocal, which allows an arbitrary value to be returned from the transformation function.
TxnLocal, previously these were only defined for
Changes between 0.5 and 0.6:
retryForadded to the Java compatibility interface.
- uses of
scala.actor.threadpool.TimeUnitin the interface replaced with
java.util.concurrent.TimeUnitto avoid making ScalaSTM depend on the separate
scala-actors.jarin Scala 2.10.
Changes between 0.4 and 0.5
scala.concurrent.stm.japi.STMadded, which makes it much cleaner to access ScalaSTM functionality from Java.
Changes between 0.3 and 0.4
CommitBarrieradded, which allows multiple atomic blocks (each on its own thread) to commit together.
- Small performance improvements.
- STMBench7 benchmark support added.
- Automatic selection of STMImpl in most cases.
Changes between 0.2 and 0.3
- Support for Scala 2.9.0.
- Timeouts for
retry. See Waiting : Timeouts.
- Bug fixes and contention management improvements
– fix for two-
StackOverflowExceptionunder heavy contention and true nesting;
- #13 – contention management improvements;
- #14 – fix for external decision support;
- #15 – NPE if a post-decision handler threw an exception;
– atomicity can be broken by
TMapcopy-on-write mechanism; and
- #19 – potential deadlock between pessimistic readers.
- #11 – fix for two-
Changes between 0.1 and 0.2
- Substantial performance improvements, especially for nested atomic
blocks. Nested atomic blocks without
orAtomicare optimistically subsumed (run directly in their parent transaction), then retried without subsumption if partial rollback is needed.
TMap.Vieware integrated into the Scala collection class hierarchy, with factory companion objects and
- A fix for
whileCommittinghandlers (issue #3).
TxnLocalcan now be read and written from while-preparing and while-committing handlers. Combining
TxnLocaland life-cycle handlers is now more concise.
- Transaction statistics can be enabled for the default algorithm with
the VM argument
-Dccstm.stats=1(for more information see the ScalaDoc for
sbt about a dependency on ScalaSTM by adding a library dependency
build.sbt file (or a Scala build file)
sbt update will then download the correct
scala-stm JAR and use it
Separate artifacts are published for each version of Scala, so the
desired Scala version (such as 2.12) must be included in the
artifactId for Maven (
sbt automatically handles this). The ScalaSTM
dependency for your
The deployment tests inside the ScalaSTM source include a complete pom.xml