Re: nptl 0.30

"Alexander Terekhov" <[email protected]>
Newsgroups gmane.comp.lib.phil
Organization http://freemail.web.de/
Message-ID <[email protected]>
"dada1" <[email protected]> schrieb am 18.03.03 13:55:32:
> 
> I beg to differ Ulrich .
> 
> May be Alexander was refering to the known futex_wake() with locked mutex
> symdrom :

I was referring to the pthread_cond_signal/broadcast(), mostly.

> 
> File sysdeps/pthread/pthread_cond_wait.c, line 61
> 
> lll_futex_wake (futex, INT_MAX);
> /* We are done.  */
> lll_mutex_unlock (cbuffer->cond->__data.__lock);
> 
> 
> That means that the awaken thread(s) will hit the locked mutex.
> 
> Just invert those lines to :
> 
> lll_mutex_unlock (cbuffer->cond->__data.__lock); /* much better to call
> futex_wake() with the mutex unlocked */
> lll_futex_wake (futex, INT_MAX);

I think that it's sufficient to wake just one single thread 
here (in cleanup() for async.cancel region "wrapping" futex 
wait(); I guess).

regards,
alexander.

______________________________________________________________________________
Werden Sie kreativ! Jetzt HTML-Mails nicht nur schreiben - nein -
GESTALTEN, bei WEB.DE FreeMail! http://freemail.web.de/features/?mc=021141
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.