This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 07/10] Add __pthread_set_abort_hook export


> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]