[PATCH 07/10] Add __pthread_set_abort_hook export

Andi Kleen andi@firstfloor.org
Fri Jan 18 23:46:00 GMT 2013


> So, what's the use case for TXN_ASSERT? 

Two use cases are:

Performance debugging:
- You have a complex transaction specific code path (e.g. with _xtest())
and there is a bug in it that causes unexpected aborts. As you say
this cannot cause functional bugs, but the unexpected abort can 
be still useful to fix to get better performance.

You can see the abort in the profiler, and get LBRs for some context,
but for complex code flows it's useful to have assert() to check
internal conditions too.

Correctness debugging:
- In rare cases programs may break due to timing dependencies or
existing races exposed by much faster locks. In this case it's useful
to have a debug facility that works in speculation too, so that
inconsistencies in other threads can be detected faster.

-Andi



More information about the Libc-alpha mailing list