This is the mail archive of the
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
Cyril Hrubis once reported a bug about pthread_rwlock() posix tests in LTP:
And there were some clarification requests for Austin Group about this issue.
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.