Welcome from the Scala STM Expert Group. We’re working on a lightweight software transactional memory for Scala, inspired by the STMs in Haskell and Clojure. Our target is inclusion in Scala’s standard library for 2.9 or the next point-release after, but you can use our draft release today. We’d like your feedback.
ScalaSTM is a single JAR with no dependencies, and includes
An API that supports multiple STM implementations
A reference implementation based on CCSTM
ScalaSTM provides a mutable cell called a Ref. If you build a shared data structure using immutable objects and Ref-s, then you can access it from multiple threads or actors. No synchronized, no deadlocks or race conditions, and good scalability. Included are concurrent sets and maps, and we also have an easier and safer replacement for wait and notifyAll.
"POSIX provides for three different variants of synchronized I/O, corresponding to the flags O_SYNC, O_DSYNC, and O_RSYNC. Currently (2.6.31), Linux only implements O_SYNC, but glibc maps O_DSYNC and O_RSYNC to the same numerical value as O_SYNC. Most Linux file systems don't actually implement the POSIX O_SYNC semantics, which require all metadata updates of a write to be on disk on returning to userspace, but only the O_DSYNC semantics, which require only actual file data and metadata necessary to retrieve it to be on disk by the time the system call returns."