summaryrefslogtreecommitdiff
path: root/doc/posix-functions
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2018-06-18 18:16:34 +0200
committerBruno Haible <bruno@clisp.org>2018-06-18 18:16:34 +0200
commit8584beae8e0f4ac4a5c128d35da43241761501db (patch)
tree64c722e63d43cbc34609384ef900adcf9bfcc31c /doc/posix-functions
parent0d45ec7c033c165ad73a6509c7fa84aa67edf4ea (diff)
downloadgnulib-8584beae8e0f4ac4a5c128d35da43241761501db.tar.gz
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.
Diffstat (limited to 'doc/posix-functions')
-rw-r--r--doc/posix-functions/pthread_rwlock_rdlock.texi9
-rw-r--r--doc/posix-functions/pthread_rwlock_timedrdlock.texi7
-rw-r--r--doc/posix-functions/pthread_rwlock_tryrdlock.texi7
3 files changed, 23 insertions, 0 deletions
diff --git a/doc/posix-functions/pthread_rwlock_rdlock.texi b/doc/posix-functions/pthread_rwlock_rdlock.texi
index 3759f782e1..387dabed77 100644
--- a/doc/posix-functions/pthread_rwlock_rdlock.texi
+++ b/doc/posix-functions/pthread_rwlock_rdlock.texi
@@ -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
diff --git a/doc/posix-functions/pthread_rwlock_timedrdlock.texi b/doc/posix-functions/pthread_rwlock_timedrdlock.texi
index 07194c1387..52cc74a789 100644
--- a/doc/posix-functions/pthread_rwlock_timedrdlock.texi
+++ b/doc/posix-functions/pthread_rwlock_timedrdlock.texi
@@ -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
diff --git a/doc/posix-functions/pthread_rwlock_tryrdlock.texi b/doc/posix-functions/pthread_rwlock_tryrdlock.texi
index 370a899aae..b817212e97 100644
--- a/doc/posix-functions/pthread_rwlock_tryrdlock.texi
+++ b/doc/posix-functions/pthread_rwlock_tryrdlock.texi
@@ -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