retrying transaction with empty read set?

27 views
Skip to first unread message

Maurice Herlihy

unread,
Jan 6, 2013, 12:16:45 PM1/6/13
to scala-stm-e...@googlegroups.com
Is it possible to roll back and immediately (or after a timeout) retry a transaction with an empty read set?

  Maurice

Nathan Bronson

unread,
Jan 6, 2013, 1:33:56 PM1/6/13
to scala-stm-e...@googlegroups.com
You can use

  val cause = Txn.OptimisticFailureCause(category, trigger)
  NestingLevel.root.requestRollback(cause)
  Txn.rollback(cause)

NestingLevel.root.requestRollback will doom the outermost transaction (and the inner ones), but does not throw the exception that causes control transfer. That will occur on the next STM access; here I trigger it immediately by calling Txn.rollback (the cause of the second rollback request will be discarded). Category and trigger can be whatever you like.

 - Nathan


On Sun, Jan 6, 2013 at 9:16 AM, Maurice Herlihy <maurice...@gmail.com> wrote:
Is it possible to roll back and immediately (or after a timeout) retry a transaction with an empty read set?

  Maurice

--
 
 
 



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