[PATCH 2/2] New pthread rwlock that is more scalable.

Torvald Riegel triegel@redhat.com
Mon Jan 2 19:26:00 GMT 2017


On Wed, 2016-07-27 at 23:44 +0200, Torvald Riegel wrote:
> This replaces the pthread rwlock with a new implementation that uses a
> more scalable algorithm (primarily through not using a critical section
> anymore to make state changes).  The fast path for rdlock acquisition
> and release is now basically a single atomic read-modify write or CAS
> and a few branches.  See nptl/pthread_rwlock_common.c for details.

I have noticed two small oversights, which are taken care of in the
attached patch.  The first is a mssign overflow check (a lock acquired
too often as a reader) in one of the tryrdlock branches.  The second is
a that I had forgotten to apply a cleanup (no correctness change; the
former code did more than it had to).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rwlock-minorfix.patch
Type: text/x-patch
Size: 3010 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20170102/b9c2778a/attachment.bin>


More information about the Libc-alpha mailing list