Re: Hang in pthread_cond_wait

Dinakar Guniguntala <[email protected]> Thu, 29 Apr 2004 19:46:04 +0530
Newsgroups gmane.comp.lib.phil
Message-ID <OFB7553E03.59B47D36-ON65256E85.004D0BCD-65256E85.004E2CEE@in.ibm.com>




> The only workaround I can think of is to remove the FUTEX_REQUEUE call
> from the broadcast function and always do a FUTEX_WAKE (ALL) instead.
> This might be bad for performances but will avoid such hangs.

Another fix for this problem is to hold the internal condvar lock
while calling futex_requeue. However the performance numbers for both
are about the same with the second fix (holding lock while calling requeue)
getting slightly better numbers. (I measured the time for 64 threads to
finish a given job for both fixes)

Regards,

Dinakar