]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
pthread-rwlock tests: Add a comment.
authorBruno Haible <bruno@clisp.org>
Fri, 16 May 2025 13:09:09 +0000 (15:09 +0200)
committerBruno Haible <bruno@clisp.org>
Fri, 16 May 2025 13:09:53 +0000 (15:09 +0200)
Reported by Natanael Copa <ncopa@alpinelinux.org> in
<https://lists.gnu.org/archive/html/bug-gnulib/2025-05/msg00164.html>.

* tests/test-pthread-rwlock.c: Explain why this test can fail.

ChangeLog
tests/test-pthread-rwlock.c

index 371af7fada6318473d94efb9b3f0a2cdcbe07a4a..95323c3a1941e8f79694415c3b0b8253ee9aa384 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2025-05-16  Bruno Haible  <bruno@clisp.org>
+
+       pthread-rwlock tests: Add a comment.
+       Reported by Natanael Copa <ncopa@alpinelinux.org> in
+       <https://lists.gnu.org/archive/html/bug-gnulib/2025-05/msg00164.html>.
+       * tests/test-pthread-rwlock.c: Explain why this test can fail.
+
 2025-05-14  Bruno Haible  <bruno@clisp.org>
 
        asyncsafe-spin: Rely on module 'spin'.
index 90d6ac5017631e4f65670810ec97878ade1c5892..8a4ab93b41fc746ddeca7112be6c23e5288a1553 100644 (file)
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2005.  */
 
+/* This test fails when writer starvation occurs
+   <https://en.wikipedia.org/wiki/Readers%E2%80%93writers_problem>.
+   It depends on the implementation of pthread rwlocks, cf.
+   <https://gitweb.git.savannah.gnu.org/gitweb/?p=gnulib/maint-tools.git;a=tree;f=test-programs/pthread-rwlock>,
+   as well as on the number of CPUs (because when there are >= 2*THREAD_COUNT
+   CPUs, the checker threads are more "efficient" at not giving away the
+   reader lock).
+   A failure was seen with musl libc/riscv64 on a machine with 64 CPUs.  */
+
 #include <config.h>
 
 #if USE_ISOC_THREADS || USE_POSIX_THREADS || USE_ISOC_AND_POSIX_THREADS || USE_WINDOWS_THREADS