Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Programming Threads > Re: Is this a w...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 5 of 12 Topic 4061 of 4146
Post > Topic >>

Re: Is this a well-known bug of POXIS pthread_cond_timewait()?

by Hallvard B Furuseth <h.b.furuseth@[EMAIL PROTECTED] > Sep 29, 2008 at 08:33 PM

David Schwartz writes:
> On 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.

...and the predicate must be protected by the mutex used in the cond_wait,
i.e. the mutex must be locked when modifying and when changing the
variables in the predicate.

-- 
Hallvard
 




 12 Posts in Topic:
Is this a well-known bug of POXIS pthread_cond_timewait()?
chima1979@[EMAIL PROTECTE  2008-09-28 20:03:13 
Re: Is this a well-known bug of POXIS pthread_cond_timewait()?
"Chris M. Thomasson&  2008-09-29 02:58:22 
Re: Is this a well-known bug of POXIS pthread_cond_timewait()?
calvin <chima1979@[EMA  2008-09-29 10:07:40 
Re: Is this a well-known bug of POXIS pthread_cond_timewait()?
David Schwartz <davids  2008-09-29 11:02:44 
Re: Is this a well-known bug of POXIS pthread_cond_timewait()?
Hallvard B Furuseth <h  2008-09-29 20:33:22 
Re: Is this a well-known bug of POXIS pthread_cond_timewait()?
Hallvard B Furuseth <h  2008-09-29 20:34:41 
Re: Is this a well-known bug of POXIS pthread_cond_timewait()?
"Chris M. Thomasson&  2008-09-30 03:24:02 
Re: Is this a well-known bug of POXIS pthread_cond_timewait()?
calvin <chima1979@[EMA  2008-09-29 11:38:43 
Re: Is this a well-known bug of POXIS pthread_cond_timewait()?
David Schwartz <davids  2008-09-29 19:22:00 
Re: Is this a well-known bug of POXIS pthread_cond_timewait()?
"Chris M. Thomasson&  2008-09-30 03:26:28 
Re: Is this a well-known bug of POXIS pthread_cond_timewait()?
"Chris M. Thomasson&  2008-09-30 03:34:58 
Re: Is this a well-known bug of POXIS pthread_cond_timewait()?
sean_in_raleigh@[EMAIL PR  2008-09-30 07:11:50 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Nov 22 9:48:21 CST 2008.