Another LinuxThreads bug.
Xavier Leroy
Xavier.Leroy@inria.fr
Tue Jan 11 01:23:00 GMT 2000
> > 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
More information about the Libc-alpha
mailing list