transaction commit

33 views
Skip to first unread message

Yarco Hayduk

unread,
Feb 28, 2013, 5:47:50 PM2/28/13
to scala-stm-e...@googlegroups.com

Hi,

I am currently trying to postpone a transaction commit and “hibernate its state”, so I can put it in a collection (for example) and commit it at a later time.

From the high level, I am trying to complete the work in block

scala.concurrent.stm.ccstm.InTxnImpl#runBlock(block)

but postpone the commit attempt

scala.concurrent.stm.ccstm.InTxnImpl#topLevelComplete

The final milestone would be to have a number of such completed, but not committed transactions in a collection, and then, at some later time, fetch them from that collection (possibly out of order) and try to commit.

I have not yet had the time to go through the specifics of your (well commented!) library, but the best candidate for “hibernation” is scala.concurrent.stm.ccstm.TxnLevelImpl. scala.concurrent.stm.ccstm.InTxnImpl looks like an thread local executor of TxnLevelImpl's to me, so it would not make much sense to mess with this class (right?)

Could you, perhaps, give me some hints as to how I should go about implementing my idea with your library?

I would very much appreciate your response!

yarco;)

Nathan Bronson

unread,
Feb 28, 2013, 6:08:32 PM2/28/13
to scala-stm-e...@googlegroups.com
Yarco,

Why are you trying to defer the commit? ScalaSTM is performing conflict resolution and retries using the commit order it chooses, so it won't in general be possible to rearrange that order without creating deadlocks.

This sounds similar to the functionality that is provided by a CommitBarrier. It doesn't change the order of transactions, but rather makes it so that several transactions (each from their own thread) all appear to commit as a single atomic unit. CommitBarrier detects any dependency cycles that arise (txn A does x() = y() and txn B does y() = x()) and throws an exception in that case.

It might also be that the "retry" operation handles your use case, I'm not sure without knowing more.

- Nathan


yarco;)

--
 
---
You received this message because you are subscribed to the Google Groups "Scala STM Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-stm-expert-...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Nathan Grasso Bronson
ngbr...@gmail.com
Reply all
Reply to author
Forward
0 new messages