Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - pthread_cond_timedwait() using CLOCK_REALTIME fails in 6.5.0, works in 6.4.1: (9 Items)
   
pthread_cond_timedwait() using CLOCK_REALTIME fails in 6.5.0, works in 6.4.1  
I am using 6.4.1 on a ppcbe board (e500 core) and 6.5.0 on an ppcbe (e500mc core) board.  I have noticed that 
pthread_cond_timedwait() only delays the specified timeout time when using CLOCK_MONOTONIC under 6.5.0.  Using 
CLOCK_REALTIME, causes pthread_cond_timedwait() to immediately return with a value of 260 (ETIMEDOUT).

Under 6.4.1, the correct behavior is observed using either CLOCK_REALTIME, or CLOCK_MONOTONIC.

Can you tell me why CLOCK_REALTIME, no longer works under 6.5.0?

Attached is a simple test file that can be used to see the behavior I am seeing.

Thanks!
Chip Bagwell
Attachment: Text cond_test.c 1.75 KB
Re: pthread_cond_timedwait() using CLOCK_REALTIME fails in 6.5.0, works in 6.4.1  
In the attachment, change CLOCK_MONOTONIC to CLOCK_REALTIME to test that behavior.

--Thanks
Chip Bagwell
Re: pthread_cond_timedwait() using CLOCK_REALTIME fails in 6.5.0, works in 6.4.1  
I've raised PR 87128 to track this.  Thanks for reporting it (with test
case)!

On Thu, 2011-02-03 at 11:57 -0500, Chip Bagwell wrote:
> In the attachment, change CLOCK_MONOTONIC to CLOCK_REALTIME to test
> that behavior.
> 
> --Thanks
> Chip Bagwell
> 
> 
> 
> _______________________________________________
> 
> OSTech
> http://community.qnx.com/sf/go/post82868
> 
> 
> 
Re: pthread_cond_timedwait() using CLOCK_REALTIME fails in 6.5.0, works in 6.4.1  
Neil,
I downloaded a 30-day eval of 6.5.0 for x86 and loaded it on Oracle VirtualBox 3.2.12.  Looks like both CLOCK_MONOTONIC 
and CLOCK_REALTIME work correctly under 6.5.0 for x86.  I also tested a 6.4.1 Neutrino install on a Quad Xeon Server I 
have access to; works fine.  Maybe this is a PPC only issue?  
Re: pthread_cond_timedwait() using CLOCK_REALTIME fails in 6.5.0, works in 6.4.1  
I certainly sounds that way.  I'll have to dig around a bit to see
what's going on, but that may take a while.

On Thu, 2011-02-03 at 13:38 -0500, Chip Bagwell wrote:
> Neil,
> I downloaded a 30-day eval of 6.5.0 for x86 and loaded it on Oracle
> VirtualBox 3.2.12.  Looks like both CLOCK_MONOTONIC and CLOCK_REALTIME
> work correctly under 6.5.0 for x86.  I also tested a 6.4.1 Neutrino
> install on a Quad Xeon Server I have access to; works fine.  Maybe
> this is a PPC only issue? 
> 
> 
> 
> _______________________________________________
> 
> OSTech
> http://community.qnx.com/sf/go/post82870
> 
> 
> 
Re: pthread_cond_timedwait() using CLOCK_REALTIME fails in 6.5.0, works in 6.4.1  
I certainly sounds that way.  I'll have to dig around a bit to see
what's going on, but that may take a while.

On Thu, 2011-02-03 at 13:38 -0500, Chip Bagwell wrote:
> Neil,
> I downloaded a 30-day eval of 6.5.0 for x86 and loaded it on Oracle
> VirtualBox 3.2.12.  Looks like both CLOCK_MONOTONIC and CLOCK_REALTIME
> work correctly under 6.5.0 for x86.  I also tested a 6.4.1 Neutrino
> install on a Quad Xeon Server I have access to; works fine.  Maybe
> this is a PPC only issue? 
> 
> 
> 
> _______________________________________________
> 
> OSTech
> http://community.qnx.com/sf/go/post82870
> 
> 
> 
Re: pthread_cond_timedwait() using CLOCK_REALTIME fails in 6.5.0, works in 6.4.1  
Well, now after seeing some additional weirdness and restarting the e500mc board, both CLOCK_MONOTONIC and 
CLOCK_REALTIME work on the 6.5.0 build on the e500mc board...  I am not sure what to make of it.  For now, I think this 
question can be considered withdrawn...

Re: pthread_cond_timedwait() using CLOCK_REALTIME fails in 6.5.0, works in 6.4.1  
I've added this note to the PR, but I'll leave it open for the time
being.

On Fri, 2011-02-04 at 11:45 -0500, Chip Bagwell wrote:
> Well, now after seeing some additional weirdness and restarting the
> e500mc board, both CLOCK_MONOTONIC and CLOCK_REALTIME work on the
> 6.5.0 build on the e500mc board...  I am not sure what to make of it.
> For now, I think this question can be considered withdrawn...
> 
> 
> 
> 
> 
> _______________________________________________
> 
> OSTech
> http://community.qnx.com/sf/go/post82908
> 
> 
> 
Re: pthread_cond_timedwait() using CLOCK_REALTIME fails in 6.5.0, works in 6.4.1  
Neil,
The RTC was set too close to the 32-bit unsigned MAX INT causing roll over issue when calculating absolute times from 
deltas to be used by pthread_cond_timedwait.  Setting the RTC to the correct time of day has fixed this problem and now 
CLOCK_REALTIME works as expected.  Although, we are all in trouble come 2106!

;-) 

You can definitely close this PR.  I have also contacted the e500mc board manufacturer and asked them to please program 
the RTC clock to something in the current year to avoid this problem on future boards.

Thanks!