This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 03/11] Add external interface changes: new lock types for pthread_mutex_t
- From: Andi Kleen <andi at firstfloor dot org>
- To: Andi Kleen <andi at firstfloor dot org>
- Cc: Torvald Riegel <triegel at redhat dot com>, libc-alpha at sourceware dot org, Andi Kleen <ak at linux dot jf dot intel dot com>
- Date: Fri, 14 Jun 2013 15:42:19 +0200
- Subject: Re: [PATCH 03/11] Add external interface changes: new lock types for pthread_mutex_t
- References: <1370969416-8337-1-git-send-email-andi at firstfloor dot org> <1370969416-8337-4-git-send-email-andi at firstfloor dot org> <1371140842 dot 16968 dot 19094 dot camel at triegel dot csb> <20130613211520 dot GP6123 at two dot firstfloor dot org> <1371192753 dot 16968 dot 19724 dot camel at triegel dot csb> <20130614131729 dot GR6123 at two dot firstfloor dot org>
That's what I wrote for the manual:
Some deadlocks that always happen on the first lock without elision may
be delayed with elision until the next abort (most elisions have a low
abort rate related to background events)
So for example a program like
@smallexample
/* lock is not a recursive lock type */
pthread_mutex_lock (&lock);
/* Relock same lock in same thread */
pthread_mutex_lock (&lock);
@end smallexample
will immediately hang on the second lock (dead lock) without elision.
With elision the deadlock will only happen after a number of invocations when
the lock eventually aborts.
--
ak@linux.intel.com -- Speaking for myself only.