Schemes to Improve the Efficiency of Hardware Transactional Memory Systems
Licentiate thesis, 2007
In todays ubiquitous multiprocessor environment parallel programming becomes
an important tool to reap the maximum gain. But the traditional lock-based parallel
programming model is not attracting average programmers as the level of expertise
needed is very high. A programcan be trapped in deadlock and livelock by unconscious
locking of shared resources. Furthermore, a lock-based parallel programming model
uses blocking synchronization where execution of a critical section is exclusive. A
processor that executes in a critical section blocks all other processor to execute inside
the critical section. The blocking nature can limit concurrency if two processors follow
two different execution paths yet in the critical section; in that case there will be no
data race. Recently, many researchers proposed transactional memory that promises to
simplify parallel programming as well as to offer non-blocking synchronization.
In transactionalmemory systems, critical sections are executed in transactionswhere
multiple transactions from different threads can be executed speculatively in parallel.
Data integrity, hence the program correctness is maintained by isolating the speculative
execution and committing atomically at the end. A commit can force other ongoing
transactions to be squashed if a data conflict is detected. Depending on the mechanism
in which the isolation, atomic commit and conflict detection is performed, transactional
memory systems could be broadly categorized as software transactionalmemory (STM)
and hardware transactional memory (HTM).
In this thesis, three problems of HTM systems that hurt the execution time are discovered
and novel solutions to the problems are proposed. In an HTM system that
detects conflicts lazily, transactions from one thread can repeatedly squash a transaction
from another thread which can lead to a starvation problem for the latter. A novel
solution that uses squash counts for individual transaction is proposed to avoid starvation.
At a data conflict, HTM systems squash the speculative executions and re-execute
the transactions from the beginning. Re-execution from the beginning may waste a part
of execution that is correct and hurt performance. A scheme is proposed that smartly
takes intermediate checkpoints so that the correct execution can be saved froma squashing
transaction. To isolate the speculative execution, a private buffer is used to store the
speculative data. The drastic effect of speculative buffer overflow is discovered and a
scheme is proposed that effectively uses the speculative buffer to reduce overflows.
transactional memory
parallel programming
chip-multiprocessor
multiprocessor