[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [PATCH] New condition variable design: OpenOffice works



phil-list redhat com schrieb am 03.11.02 07:34:05:
> On Sat, 2 Nov 2002, Alexander Terekhov wrote:
> 
> > P.S. Oh, BTW, I'm just curious: who's the author of NPTL's
> > DESIGN-rwlock.txt?
> 
> i wrote the DESIGN-*.txt pseudocode, with fixes & suggestions from Ulrich.  
> The actual implementation in NPTL is Ulrich's.
> 
> 	Ingo

It seems to me that the way how you handle futex value transitions
[0<->1] and waiting in the current rwlock is well, ``Not Good.''

    futex_wait(&rwlock->readers_wakeup, 0)

Unless I'm just missing and/or misunderstanding something, this 
might easily degrade to busy-waiting/spinning -- the futex values 
aren't guaranteed to be zero, as far as I can see.

    if (!--rwlock->nr_readers_queued)
        rwlock->readers_wakeup = 0;


This perceived problem aside, you might want to take a look at 
the discussion ["poor"/"ideal" rwlock, etc.] in the following 
c.p.t. thread:

http://groups.google.com/groups?selm=e5d6e3f1.0209160258.d14d9e6%40posting.google.com
(comp.programming.threads, Subject: rwlock using pthread_cond)

regards,
alexander.

________________________________________________________________
Keine verlorenen Lotto-Quittungen, keine vergessenen Gewinne mehr! 
Beim WEB.DE Lottoservice: http://tippen2.web.de/?x=13






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]