]> Savannah Git Hosting - gnulib.git/commitdiff
pthread_rwlock_rdlock: Add comments regarding glibc behaviour.
authorBruno Haible <bruno@clisp.org>
Mon, 18 Jun 2018 16:16:34 +0000 (18:16 +0200)
committerBruno Haible <bruno@clisp.org>
Mon, 18 Jun 2018 16:16:34 +0000 (18:16 +0200)
* m4/pthread_rwlock_rdlock.m4: Add comment.
* doc/posix-functions/pthread_rwlock_rdlock.texi: Mention that rwlocks
are reader-preferring in glibc.
* doc/posix-functions/pthread_rwlock_tryrdlock.texi: Likwise.
* doc/posix-functions/pthread_rwlock_timedrdlock.texi: Likewise.

ChangeLog
doc/posix-functions/pthread_rwlock_rdlock.texi
doc/posix-functions/pthread_rwlock_timedrdlock.texi
doc/posix-functions/pthread_rwlock_tryrdlock.texi
m4/pthread_rwlock_rdlock.m4

index 1bda21b2756df2c4af60b8647ad2f1cbc99420d1..beaaf26a58d8fdc89d01d94396519c292351f830 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2018-06-18  Bruno Haible  <bruno@clisp.org>
+
+       pthread_rwlock_rdlock: Add comments regarding glibc behaviour.
+       * m4/pthread_rwlock_rdlock.m4: Add comment.
+       * doc/posix-functions/pthread_rwlock_rdlock.texi: Mention that rwlocks
+       are reader-preferring in glibc.
+       * doc/posix-functions/pthread_rwlock_tryrdlock.texi: Likwise.
+       * doc/posix-functions/pthread_rwlock_timedrdlock.texi: Likewise.
+
 2018-06-17  Paul Eggert  <eggert@cs.ucla.edu>
 
        crypto: use byteswap
index 3759f782e128ad509dbcb38ba8546cd6d6a6481a..387dabed7792626a651f16b28fce0e86aab123a1 100644 (file)
@@ -15,4 +15,13 @@ Portability problems not fixed by Gnulib:
 @item
 This function is missing on some platforms:
 Minix 3.1.8, HP-UX 11, OSF/1 4.0, Solaris 2.6, mingw, MSVC 14, BeOS.
+@item
+This function prefers readers to writers (meaning, when this function is
+called on an rwlock that is already taken by one or more readers, and
+another writer is already waiting to take it, this function may return
+successfully immediately) -- a behaviour that may lead to writer starvation --
+on some platforms:
+glibc 2.28.
+As a workaround, you can use the @code(gl_rwlock_t} type from the Gnulib
+module @samp{lock}.
 @end itemize
index 07194c1387de2c87c72dc48e9f2b67c50acf89fa..52cc74a7899be0d0f5c93f26a3f1ff9519361b59 100644 (file)
@@ -15,4 +15,11 @@ Portability problems not fixed by Gnulib:
 @item
 This function is missing on some platforms:
 Mac OS X 10.5, FreeBSD 5.2.1, OpenBSD 3.8, Minix 3.1.8, AIX 5.1, HP-UX 11, IRIX 6.5, OSF/1 5.1, Solaris 9, Cygwin, mingw, MSVC 14, BeOS.
+@item
+This function prefers readers to writers (meaning, when this function is
+called on an rwlock that is already taken by one or more readers, and
+another writer is already waiting to take it, this function may return
+successfully immediately) -- a behaviour that may lead to writer starvation --
+on some platforms:
+glibc 2.28.
 @end itemize
index 370a899aae376febce45e431bdd3e0beb8ac5950..b817212e97a19bae6a8cecbf81d53750408ce890 100644 (file)
@@ -15,4 +15,11 @@ Portability problems not fixed by Gnulib:
 @item
 This function is missing on some platforms:
 Minix 3.1.8, HP-UX 11, OSF/1 4.0, Solaris 2.6, mingw, MSVC 14, BeOS.
+@item
+This function prefers readers to writers (meaning, when this function is
+called on an rwlock that is already taken by one or more readers, and
+another writer is already waiting to take it, this function may return
+successfully immediately) -- a behaviour that may lead to writer starvation --
+on some platforms:
+glibc 2.28.
 @end itemize
index 9c1d5d019317b5a8dc608040012df1dae9387dc5..6812b4f4e24b00b8f91520dd3323aebe0f001d48 100644 (file)
@@ -1,4 +1,4 @@
-# pthread_rwlock_rdlock.m4 serial 1
+# pthread_rwlock_rdlock.m4 serial 2
 dnl Copyright (C) 2017-2018 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -23,12 +23,14 @@ dnl time, a phenomenon called "writer starvation".
 dnl Without such a guarantee, applications have a hard time avoiding writer
 dnl starvation.
 dnl
-dnl POSIX:2008 makes this requirement only for implementations that support TPS
+dnl POSIX:2017 makes this requirement only for implementations that support TPS
 dnl (Thread Priority Scheduling) and only for the scheduling policies SCHED_FIFO
 dnl and SCHED_RR, see
 dnl http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_rwlock_rdlock.html
-dnl but test verifies the guarantee regardless of TPS and regardless of
+dnl but this test verifies the guarantee regardless of TPS and regardless of
 dnl scheduling policy.
+dnl Glibc currently does not provide this guarantee, see
+dnl https://sourceware.org/bugzilla/show_bug.cgi?id=13701
 AC_DEFUN([gl_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER],
 [
   AC_REQUIRE([gl_THREADLIB_EARLY])