On 01/24/2012 07:32 PM, Torvald Riegel wrote:
* Remove ITM_REGPARM from _ITM_beginTransaction since on x86-32, a
> variadic function ignores regparm.
> * Add ITM_PURE to _ITM_addUserCommitAction and _ITM_addUserUndoAction to
> be usable inside transactions.
Those should be called from transaction_pure code only, or from wrapper
functions linked to using transaction_wrapper. Thus, they don't need to
be pure. Alternatively, why should they be?
I though it was also allowed to be called inside transaction_safe code.
This way, the developer has some callbacks on transactions events.
example:
void ucommit(void *arg)
{
printf("Committed. now we can do undoable action (as printf) or ...\n");
}
__transaction_atomic {
_ITM_addUserCommitAction(ucommit, _ITM_noTransactionId, NULL);
...
}
I read the ABI and right they seem to focus on the case of tm_wrap. In
fact, I found those calls quite convenient sometimes but definitely not
a problem for me.
Note that GCC does not annotate wrapped function automatically as
transaction_pure. So the wrapper has to be transaction_pure too. I don't
know if we should consider as a bug (Intel STM compiler adds the
transaction_pure attribute automatically) or a feature of GCC.
In fact, I found this also quite cool to be able to propose an
alternative and transactified function when used in transaction.
Thanks.
--
Patrick.