2
$\begingroup$

I've been reading the paper Software Transactional Memory by Shavit and Touitou. I understand how STM works in general but I need to understand this paper as it is the founding paper of the concept. However, I'm missing something rather fundamental of transactions. When I reed through the paper I never see what happens when a transaction fails. In general STM should retry a transaction when it fails, until it succeeds.

What the paper proposes is the following:

When a transaction starts it acquires the ownership of all the memory locations. Next, it computes the new values of each memory reference and writes them back to global memory. Finally, the transaction releases the ownerships. The transaction has succeeded and returns "success".

If a transaction tries to acquire ownership of a memory reference that is already owned by another transaction it will "help" this transaction by running the same transaction. But only if the owning transaction is not in the failed state or success state.

A transaction goes into the success state when it has successfully acquired all the locks. It goes into the failed state when

But, nowhere in the paper can I find something about retrying a transaction?

For example, I have applied the pseudocode in the text to this scenario:

Suppose a transaction T1 that wants to run on dataset [A, B, C] and a transaction T2 that wants to run on dataset [C, D, E]. No other transactions are running in the system.

In order of execution:

  • T1 successfully acquires the locks for A, B and C
  • T1 now has the state success because it acquired all the ownerships.
  • T2 wants to acquire the locks for C, D and E.
  • T2 can not acquire the lock for C.
  • T2 its status changes to Failure
  • T2 releases all the ownerships it had (none at the moment)
  • T2 knows that C is the reference that caused the failure.
  • T2 executes the same transaction as the process that owns C.
  • T2 notices that T1 already is in the success state so it aborts.
  • T1 safely executes its transactions and commits the changes to the global memory

So nowhere in this scenario is T1 executed again?

Any insights are greatly appreciated!

$\endgroup$
2
$\begingroup$

So nowhere in this scenario is T1 executed again?

"Retry" is not among the main topics of the classic STM paper.

You can let the initiator of $T_1$ call StartTransaction() (treat $T_1$ as a new transaction) upon each Failure until it receives a Success. The authors have just ignored it probably because they want to focus on the ingenious STM concept.

Retry is of course a big topic itself, for instance, in Composable Memory Transactions.

$\endgroup$
  • $\begingroup$ Aha. that makes sense they have proven non-blockingness of the STM. I was just confused with the helping and perhaps I was missing something there. Thank you for your feedback! $\endgroup$ – Christophe De Troyer Apr 18 '15 at 8:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.