threads/128180: pthread_cond_broadcast(3) lost wakeup
Ed Maste
emaste at freebsd.org
Tue Nov 4 06:40:04 PST 2008
The following reply was made to PR threads/128180; it has been noted by GNATS.
From: Ed Maste <emaste at freebsd.org>
To: bug-followup at FreeBSD.org, kurt at intricatesoftware.com
Cc:
Subject: Re: threads/128180: pthread_cond_broadcast(3) lost wakeup
Date: Tue, 4 Nov 2008 09:09:38 -0500
> The test program doesn't look correct to me. It seems possible
> for only a few of the threads (as little as 2) to do all the
> work. Thread 1 can start doing work, then wait for a broadcast.
> Thread 2 can start doing his work, then broadcast waking thread 1.
It looks to me like the "tickets" and "finished" globals should make
the test program operate correctly. If the scenario you describe
happens, thread 1 will just enter pthread_cond_wait again and wait
for the broadcast from the primordial thread.
More information about the freebsd-threads
mailing list