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.


> > 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).
> 
> ... or, more likely, that he doesn't support recursive read
> locks. We know how Dave feels about recursive locks. I don't have a
> book, but I can look at it in a bookstore

The code is on-line at 
        http://www.aw.com/cseng/titles/0-201-63392-2/code/rwlock.c
as well as the other examples in the book, at
        http://cseng.aw.com/bookdetail.qry?ISBN=0-201-63392-2&ptype=1482

The code implements reader preference, but Butenhof says (about the
rwl_readlock function) that it can be changed to writer preference by
blocking "while there are waiting writers (w_wait > 0), not merely
while there are active writers, as we do here".

- Xavier

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