This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

rwlocks and priority issues


hi there,

I'm trying to familiarize myself with the posix_rwlock API
and I wrote a little test application to get started.
The application runs three threads, all three with a while
loop, acquiring the lock, waiting some time, and releasing it.

Two of these threads use pthread_rwlock_rdlock, the third
uses pthread_rwlock_wrlock.

From the documentation I would expect the write lock to have
priority, i.e. to get the lock as soon as the currently helt
read locks are released.
However, in reality the writer lock *never* gets the lock,
the readers are served first.

Am I misinterpreting the semantics of rwlocks, or is this
a bug in the rwlock implementation ?

Thanks for any help,
		Stefan

PS: the behavior is identical with the 'old' and the 'new'
    threading library, as tested with RH 8 and RH 9


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]