This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Fix missing wake-ups in pthread_rwlock_rdlock.
- From: Torvald Riegel <triegel at redhat dot com>
- To: GLIBC Devel <libc-alpha at sourceware dot org>
- Cc: "Carlos O'Donell" <carlos at redhat dot com>, Siddhesh Poyarekar <siddhesh at redhat dot com>
- Date: Wed, 13 May 2015 11:10:55 +0200
- Subject: Re: [PATCH] Fix missing wake-ups in pthread_rwlock_rdlock.
- Authentication-results: sourceware.org; auth=none
- References: <1430324726 dot 4450 dot 107 dot camel at triegel dot csb>
Ping.
On Wed, 2015-04-29 at 18:25 +0200, Torvald Riegel wrote:
> This adds wake-ups that would be missing if assuming that for a
> non-writer-preferring rwlock, if one thread has acquired a rdlock and
> does not release it, another thread will eventually acquire a rdlock too
> despite concurrent write lock acquisition attempts. BZ 14958 is about
> supporting this assumption.
>
> I've commented on the BZ why I think that strictly speaking, this isn't
> a valid test case, but nonetheless worth supporting:
> https://sourceware.org/bugzilla/show_bug.cgi?id=14958#c7
>
> I have no intention to work on supporting the requirements about Thread
> Execution Scheduling and priorities for pthread_rwlock_rdlock (see BZ
> 13701); we claim to support it, so with this patch, we can claim that we
> assume assume the priorities to all be equal (in which case readers are
> to be preferred). See
> http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_rwlock_rdlock.html
>
> Tested on x86_64-linux. (Applies on top of the other rwlock fix I sent.)
> OK?
>
> 2015-04-28 Torvald Riegel <triegel@redhat.com>
>
> [BZ #14958]
> * nptl/pthread_rwlock_rdlock.c (__pthread_rwlock_rdlock): Add missing
> wake-up.
> (__pthread_rwlock_rdlock_slow): Likewise.
> * nptl/pthread_rwlock_timedrdlock.c (pthread_rwlock_timedrdlock):
> Likewise.
> * nptl/pthread_rwlock_tryrdlock.c (__pthread_rwlock_tryrdlock):
> Likewise.
> * nptl/pthread_rwlock_unlock.c (__pthread_rwlock_unlock): Add comments.
> * nptl/tst-rwlock16.c: New file.
> * nptl/Makefile (tests): Add new test.