This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 06/11] Add lock elision to rwlocks
- From: Andi Kleen <andi at firstfloor dot org>
- To: Torvald Riegel <triegel at redhat dot com>
- Cc: Andi Kleen <andi at firstfloor dot org>, libc-alpha at sourceware dot org, Andi Kleen <ak at linux dot jf dot intel dot com>
- Date: Thu, 13 Jun 2013 19:50:20 +0200
- Subject: Re: [PATCH 06/11] Add lock elision to rwlocks
- References: <1370969416-8337-1-git-send-email-andi at firstfloor dot org> <1370969416-8337-7-git-send-email-andi at firstfloor dot org> <1371140902 dot 16968 dot 19098 dot camel at triegel dot csb>
> We cannot use elision for trywrlock() or wrlock() because this would
> change the semantics and violate POSIX semantics. See the guidelines.
> Just using elision in rdlock and tryrdlock is okay.
The rwlock implement the same semantics now, as the normal locks.
Only when you set elision explicitely in the program does the
write lock elide. The read lock always elides.
I didn't make this clear in the description, but that is what the
current code does. I'll fix the description.
-Andi