This is the mail archive of the libc-alpha@sourceware.cygnus.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]

Re: Another LinuxThreads bug.


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. 


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