The usual debugging operations such as breakpoints work normally within
lock-based critical sections
RCU read-side critical sections.
initial transactional-memory hardware implementations
an exception within a transaction will abort that transaction,
which in turn means that breakpoints abort all enclosing transactions.
So how can transactions be debugged?
- Use software emulation techniques within transactions containing
Of course, it might be necessary to emulate all transactions any
time a breakpoint is set within the scope of any transaction.
If the runtime system is unable to determine whether or not
a given breakpoint is within the scope of a transaction, then
it might be necessary to emulate all transactions just
to be on the safe side.
Of course, this approach might impose significant overhead,
which might in turn obscure the bug being pursued.
- Use only hardware TM implementations that are capable of handling
Unfortunately, as of this writing (September 2008), all such
implementations are strictly research prototypes.
- Use only software TM implementations, which are (very roughly
speaking) more tolerant of exceptions than are the simpler
of the hardware TM implementations.
Of course, software TM tends to have higher overhead than
hardware TM, so this approach may not be acceptable in all situations.
- Program more carefully, so as to avoid having bugs in the
transactions in the first place.
As soon as you figure out how to do this, please do let me
know the secret!!!
There is some reason to believe that transactional memory will deliver
productivity improvements compared to other synchronization mechanisms,
but it does seem quite possible that these improvements could easily
be lost if traditional debugging techniques cannot be applied to
This seems especially true if transactional memory is to be used
by novices on large transactions.
In contrast, macho top-gun programmers
might be able to dispense with such debugging aids, especially for
Therefore, if transactional memory is to deliver on its productivity
promises to novice programmers, the debugging problem does need
to be solved.