This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
pthread_rwlock and writers preference
- From: Xiaoguang Wang <wangxg dot fnst at cn dot fujitsu dot com>
- To: <libc-alpha at sourceware dot org>
- Date: Thu, 3 Apr 2014 19:16:36 +0800
- Subject: pthread_rwlock and writers preference
- Authentication-results: sourceware.org; auth=none
Hi!
Cyril Hrubis once reported a bug about pthread_rwlock() posix tests in LTP:
https://sourceware.org/bugzilla/show_bug.cgi?id=13701
And there were some clarification requests for Austin Group about this issue.
see:
http://austingroupbugs.net/view.php?id=720
http://austingroupbugs.net/view.php?id=722
According to the discussion results, it seems that write locks should be implemented to
take precedence before the read locks.
But actually in glibc, if a reader has owned the lock and a writers is waiting on the lock,
now if another reader tries to get this lock, it will succeed. This is not correct behavior
according to pthread_rwlock_rdlock()'s manpage.
Would anyone help to confirm whether is this a glibc bug or should be fixed? Thanks.
Regards,
Xiaoguang Wang