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 Tue, 11 Jan 2000, Xavier Leroy wrote:

> > ... 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

Doh! ;)

> 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".

It's a nice and straightforward implementation, and it's about equivalent
to what LinuxThreads has now. It doesn't support recursive read locks.
Rather, that is to say, if writer preference is supported in the suggested
way, then it won't support recursive read locks.

I like how he splits up the unlock operation into a read unlock and write
unlock. The caller should know what type of lock it placed, after all.


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