Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

pthread_cond_timedwait() returning ETIMEDOUT too soon?

807575Jan 24 2007 — edited Jan 27 2007
I have two threads in my program. I would like the thread containing main() to spawn a new thread to perform a complicated task for up to five minutes, but kill it if it takes too long. I've been trying to accomplish this with a pthread_cond_timedwait, but it seems that this function can sometimes return ETIMEDOUT after no where near the correct amount of time has elapsed. A post at http://dbforums.com/showthread.php?t=769084 suggests that this might be caused by an hourly NTP synchronization changing the system clock time and invalidating the waiting timer. Is there any good way to work around this issue, or to handle a thread timing out more intelligently?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 24 2007
Added on Jan 24 2007
6 comments
570 views