This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Optimize libc_lock_lock for MIPS XLP.
- From: Chris Metcalf <cmetcalf at tilera dot com>
- To: Maxim Kuvyrkov <maxim at codesourcery dot com>
- Cc: Tom de Vries <Tom_deVries at mentor dot com>, "Joseph S. Myers"<joseph at codesourcery dot com>, GLIBC Devel <libc-alpha at sourceware dot org>,<libc-ports at sourceware dot org>, Tom de Vries <vries at codesourcery dot com>
- Date: Tue, 14 Aug 2012 15:33:00 -0400
- Subject: Re: [PATCH] Optimize libc_lock_lock for MIPS XLP.
- References: <FC4EF172-B43E-4298-A2E9-681FA28650DB@mentor.com> <4FD9DB74.8080905@tilera.com> <40CBC472-71CC-4FF3-A452-073B76701215@codesourcery.com> <4FDAA190.3050706@tilera.com> <C8A2E1C0-8B9E-4C07-96F6-3F83C2E88C61@codesourcery.com> <15EB7E17-5692-4221-A1B1-FC16EA236BFF@codesourcery.com> <4FEC94AF.40301@tilera.com> <4FF73F75.6060303@mentor.com> <7CC74175-BA9B-4461-8918-9D99DABEC484@codesourcery.com>
On 8/14/2012 12:00 AM, Maxim Kuvyrkov wrote:
> + atomic_compared_and_exchange_acq take the same time to execute.
Typo.
> + if (__result >= 2) \
> + __result = (atomic_exchange_acq (__futex, 2) != 0); \
Why not just return the old value in memory here (i.e. omit the "!= 0"), as
you do with the exchange_and_add above? That seems more parallel in
structure, and also more efficient.
--
Chris Metcalf, Tilera Corp.
http://www.tilera.com