This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Difference between elision-lock.c and -trylock.c
- From: Dominik Vogt <vogt at linux dot vnet dot ibm dot com>
- To: libc-alpha at sourceware dot org
- Cc: andi at firstfloor dot org
- Date: Mon, 22 Jul 2013 11:49:55 +0200
- Subject: Difference between elision-lock.c and -trylock.c
- Reply-to: libc-alpha at sourceware dot org
Why does elision-trylock.c _not_ have this code from
elision-lock.c?
if ((status & _XABORT_EXPLICIT)
&& _XABORT_CODE (status) == _ABORT_LOCK_BUSY)
{
/* Right now we skip here. Better would be to wait a bit
and retry. This likely needs some spinning. */
if (*adapt_count != aconf.skip_lock_busy)
*adapt_count = aconf.skip_lock_busy;
}
I cannot think of a reason for that; if a lock is elided via
trylock() and the transaction aborts, shouldn't the adapt_count be
updated just the same as if the lock had been elided with lock()?
Currently the abort code set with
_xabort (_ABORT_LOCK_BUSY);
is completely ignored.
Ciao
Dominik ^_^ ^_^
--
Dominik Vogt
IBM Germany