"David Schwartz" <davids@[EMAIL PROTECTED]
> wrote in message
news:fc52aafe-c9c3-491b-b09e-e7ebac6a15f9@[EMAIL PROTECTED]
Sep 29, 10:07 am, 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.
Right. Good point. In addition, one should also check the predicate after
a
timeout is encountered. Also, the OP says his threads "never" wake-up...
Well, I wonder if he is using `pthread_cond_timedwait' or not? I mean,
AFAICT, the fact that he uses the word "never" implies that a timeout
condition is never hit. To the OP: how long is your timeout interval? Have
you waited that long?


|