Another LinuxThreads bug.
Kaz Kylheku
kaz@ashi.footprints.net
Mon Jan 10 16:48:00 GMT 2000
On Mon, 10 Jan 2000, Xavier Leroy wrote:
> > By making write-priority work correctly, I broke the above
> > requirement, because I had no clue that recursive read locks are
> > permissible. If a thread which holds a read lock tries to acquire
> > another read lock, and now one or more writers is waiting for a
> > write lock, then the algorithm will lead to an obvious deadlock. The
> > reader will be suspended, waiting for the writers to acquire and
> > release the lock, and the writers will be suspended waiting for
> > every existing read lock to be released.
>
> That's an interesting twist! I have no solution to offer right now,
> but I believe Butenhof's book contains an implementation of RW locks
> in terms of basic POSIX primitives. That could give us some clues
> (although it could be that he simply doesn't implement writer
> preferencing).
By the way, I just submitted a defect report to The Single UNIX Specification.
I believe that requiring recursive read locks is wrong and defective. I hope
they resolve it in our favor, but I wouldn't hold my breath. ;)
One way to fix a bug is to have the specification changed.
More information about the Libc-alpha
mailing list