So, in the end, I don't see any better action than to add a comment:

2025-05-16  Bruno Haible  <br...@clisp.org>

        pthread-rwlock tests: Add a comment.
        Reported by Natanael Copa <nc...@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.

diff --git a/tests/test-pthread-rwlock.c b/tests/test-pthread-rwlock.c
index 90d6ac5017..8a4ab93b41 100644
--- a/tests/test-pthread-rwlock.c
+++ b/tests/test-pthread-rwlock.c
@@ -16,6 +16,15 @@
 
 /* Written by Bruno Haible <br...@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




Reply via email to