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:
T1successfully acquires the locks forA,BandCT1now has the statesuccessbecause it acquired all the ownerships.T2wants to acquire the locks forC,DandE.T2can not acquire the lock forC.T2its status changes toFailureT2releases all the ownerships it had (none at the moment)T2knows thatCis the reference that caused the failure.T2executes the same transaction as the process that ownsC.T2notices thatT1already is in thesuccessstate so it aborts.T1safely 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!