HParSTM: A Hierarchy-based STM Protocol for Supporting Nested Parallelism Ranjeet Kumar
- K. Vidyasankar
Memorial University
- St. John’s
K. Vidyasankar Memorial University St. Johns CANADA Software - - PowerPoint PPT Presentation
HParSTM: A Hierarchy-based STM Protocol for Supporting Nested Parallelism Ranjeet Kumar K. Vidyasankar Memorial University St. Johns CANADA Software Transactional Memory (STM) Systems Processes execute programs. Atomic regions are
Processes execute programs. Atomic regions are specified in the programs. Atomic regions are treated as transactions. Transactions are executed concurrently. Correctness of concurrent executions is to be assured
TRANSACT 2011 2
Opacity
Both committed and aborted transactions should read from
The state resulting from a (strongly) serializable execution of
TRANSACT 2011 3
Nested transactions
A (root-level) transaction consists of sub-transactions, which
Closed nested transactions
Aborted sub-transactions are ignored. Commitment of sub-transactions are local – at the parent
Only the writes of the root-level transactions affect the
We extend Imbs and Raynal’s [OPODIS 2008]
TRANSACT 2011 4
Three phases
Execution phase – writes are done in local copies of objects. Validation phase. Write phase – local copy values are written in global copies
Validation of a transaction amounts to ensuring that
We consider validation phase and write phase
TRANSACT 2011 5
Validation of t1 fails since x value has been
TRANSACT 2011 6
t1 starts r1(x) t2 validates &
writes w2(x), w2(y)
r1(y) t1 comes up for
validation
Validation of t1 fails since x value has been
x and y values that t1 read are not from a consistent
We want aborted transactions also to read from
t1 should be forbidden to read y.
TRANSACT 2011 7
t1 starts r1(x) t2 validates &
writes w2(x), w2(y)
r1(y) t1 comes up for
validation
The reads are made visible. TRANSACT 2011 8
t1 starts r1(x) t2 validates &
writes w2(x), w2(y)
r1(y)
add t1 to x.rs add t1 to ow, x.fbd, y.fbd disallow since t1 is in y.fbd
Reads are visible. When a read step is forbidden, the transaction is
Validation of a transaction t succeeds if t is a read-
TRANSACT 2011 9
Imbs and Raynal’s approach is employed at each
For each sub-transaction t, we have
Local copies of objects accessed by t Set ow Sets x.rs, x.fbd, for each local object x.
TRANSACT 2011 10
Read
If the value is not available locally, then it is obtained from
In the worst case, the value from the global copy is read. To read x from an ancestor t’, we need to ensure that
Commit
The commitment conditions as in Imbs and Raynal’s protocol
In addition, we need to check compatibility. An aborted transaction’s write steps as well as read steps
TRANSACT 2011 11
For each sub-transaction t,
We allow t as well as its children to execute concurrently. If t is aborted, then all the descendants of t are also
t will be committed only after all its children have committed
TRANSACT 2011 12
t111 and hence t11 should occur before t12. t112 and hence t11 should occur after t12.
TRANSACT 2011 13
1 2 3
Incompatible sibling transactions are kept track of. If one commits, then the other, incompatible,
TRANSACT 2011 14
The schedule resulting from pruning all aborted sub-
For each aborted sub-transaction t, the schedule
TRANSACT 2011 15
Overhead
Buffers and auxiliary sets (ow, x.rs, x.fbd, etc.) at every
Lock management at every level; and Transfer of data between levels.
Can sub-transactions be executed independently?
Needed data can be sent as parameters? Other data can be read directly from global values?
Mixing both will not work in certain cases.
Types of workload
Flexible parallelism – limiting concurrent executions of child
TRANSACT 2011 16