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
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 for
T1now has the state
successbecause it acquired all the ownerships.
T2wants to acquire the locks for
T2can not acquire the lock for
T2its status changes to
T2releases all the ownerships it had (none at the moment)
Cis the reference that caused the failure.
T2executes the same transaction as the process that owns
T1already is in the
successstate 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!