Thanks, DS. So POSIX does has such a bug?
What do you mean "This bug usually occurs because a thread called
pthread_cond_wait when it should not have." I think whether a thread
should call pthread_cond_wait is the merely logic of my problem,
right?
On Sep 29, 11:02=A0am, David Schwartz <dav...@[EMAIL PROTECTED]
> wrote:
> On Sep 29, 10:07=A0am, calvin <chima1...@[EMAIL PROTECTED]
> wrote:
>
> > Thanks, but this has nothing to do with predicater. The threads waits
> > on a cond "never" wake up, even some other threads broadcasts.
> > Also, this is rare, and only happens when CPU load is high. In 99.9%
> > time it works well. That's why I suspect it's a POSIX's bug.
>
> This bug usually occurs because a thread called pthread_cond_wait when
> it should not have. You must check the predicate before calling
> pthread_cond_wait.
>
> DS


|