[m-rev.] For review: Workaround Linux NTPL TSX bug (Mercury Bug: 334)

Peter Wang novalazy at gmail.com
Fri Jun 27 15:33:46 AEST 2014


On Fri, 27 Jun 2014 11:27:40 +1000, Paul Bone <paul at bone.id.au> wrote:
> 
> Of course my change here is only a workaround.  The real fix is patching
> glibc.

Well, I prefer you do not commit it.  If it's just to continue your
development, I think you could rebuild glibc with --disable-lock-elision
and LD_PRELOAD libpthread?

Otherwise, from what I can tell, calling pthread_mutexattr_settype with
PTHREAD_MUTEX_DEFAULT (or maybe PTHREAD_MUTEX_NORMAL) is enough to
disable lock elision, which is the same type of mutex as for
PTHREAD_MUTEX_INITIALIZER.  You don't need to test the glibc version.

Peter



More information about the reviews mailing list