Hang in pthread_cond_wait

Dinakar Guniguntala dgunigun at in.ibm.com
Thu Apr 29 14:16:04 UTC 2004






> 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





More information about the Phil-list mailing list