Plans for Multiverse 0.4

The 0.3 release of the software transactional memory implementation Multiverse is almost complete. I already started with the 0.4 release and it will get the following transaction execution models:

  1. readonly transaction with tracking reads; useful blocking operations and also to prevent unwanted load failures once a read has been executed
  2. readonly transaction without readtracking (already available in the 0.3 release)
  3. update transaction without read tracking (reduces stress on the transaction), but it could be subject to writeskews and can’t be used for blocking operations
  4. update transaction with read tracking (already available in the 0.3 release). This is useful for blocking operations but also for detecting write-skew problems. In the 0.4 detection for writeskew detection will be configurable

The 0.4 release also is going to get a mechanism that selects the optimal transaction implementation based on the number of reads/writes done on a transaction.

  1. tiny: optimized for a single atomic object (completely optimized to reduce object creation as much as possible)
  2. bound length: optimized for a maximum number of atomic objects e.g. 10 (based on an array)
  3. unbound length: optimized for bigger transaction (based on a map)

I have created some prototypes the show a big performance improvement for tiny transactions (2 a 3 times faster than growing-transactions). And based on the transaction familyname (if annotations are used, family name will be inferred automatically), the system will select the optimal implementation. The systems starts with tiny transactions, and if an implementation wasn’t ‘big’ enough, the transaction is aborted and a ‘larger’ implementation (or different settings) are used for the following transaction. This is completely invisible to the programmer apart from having some transaction failures in the beginning. But since transactions are retried automatically, this shouldn’t be a big problem.

The following features are also planned (or already partially implemented) for the 0.4 release:

  1. TransactionalTreeMap
  2. TransactionalTreeSet
  3. Transactional primitives (IntRef, BooleanRef etc)
  4. Support for subclassing atomic objects.
  5. Preventing unwanted object creation in transactions (Tranlocal objects are only cloned for local usage when they are written, not when read)
  6. Support for 2 phase commit to make distributed transactions possible. This was requested by Jonas Boner of the Akka project that used Multiverse as the STM implementation.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: