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

Re: problems with pthread_cond_broadcast

I believe this problem has been resolved with Update 2 level of NPTL.
(or the current cvs)
Though I really didn't dig deep to see what the problem was

                      Thorsten Kukuk                                                                                                 
                      <kukuk suse de>          To:       phil-list redhat com                                                        
                      Sent by:                 cc:                                                                                   
                      phil-list-bounces        Subject:  problems with pthread_cond_broadcast                                        
                      04/15/2004 11:20                                                                                               


I have a problem with pthread_cond_wait/pthread_cond_broadcast
waiting sometimes forever on a fast SMP machine. Attached is a
simple test case.

If I use the order
  pthread_mutex_unlock (&lock);
  pthread_cond_broadcast (&pcond);

with NPTL, the program will hang after a short time running with
current glibc + NPTL + kernel 2.6.x on all architectures I tested.

If I revert the order to
  pthread_cond_broadcast (&pcond);
  pthread_mutex_unlock (&lock);

it works fine.

Is this a problem of the test case (since pthread_cond_broadcast and
pthread_cond_wait will access pcond at the same time in different
threads) or is this a glibc/NPTL/kernel problem?

 Thanks for any hint,

Thorsten Kukuk       http://www.suse.de/~kukuk/        kukuk suse de
SuSE Linux AG        Maxfeldstr. 5                 D-90409 Nuernberg
Key fingerprint = A368 676B 5E1B 3E46 CFCE  2D97 F8FD 4E23 56C6 FB4B

Phil-list mailing list
Phil-list redhat com

#### breaknptl.c has been removed from this note on April 15 2004 by
Dinakar Guniguntala

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