LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-06-2009, 03:39 PM   #1
ljratner
LQ Newbie
 
Registered: May 2009
Posts: 5

Rep: Reputation: 0
Question Posix timers affected by system clock changes.


I'm trying to use posix timers and running into a problem. They are affected by system clock changes when I think they should not be.

I'm using CLOCK_REALTIME clock and setting a relative timer (not setting the TIMER_ABSTIME flag.) On kernel.org I read the following:
If the value of the CLOCK_REALTIME clock is adjusted while an absolute timer based on that clock is armed, then the expiration of the timer will be appropriately adjusted. Adjustments to the CLOCK_REALTIME clock have no effect on relative timers based on that clock.
On my system, the "no effect on relative timers" statement is proving false.

OK, no problem, I can use CLOCK_MONOTONIC instead. Except that it seems to not be supported on my build. When I try to use that, my application dies with a segfault. The core file tells me it is dying in librt.so in function mq_timedreceive().

I also considered switching (back) to using setitimer instead of posix timers, but I have to have timer_getoverrun() or equivalent.

So, I either need timers that work according to the spec, or I need a monotonic clock, and I don't know how to get either one.

The gory details:
kernel is 2.6.17.6
librt is 2.3.5
libc is 2.3.5
system is ppc_6xx

Any help greatly appreciated.

Logan Ratner | Software Engineer | Gas Chromatographs
Emerson Process Management | 5650 Brittmoore Rd | Houston | TX | 77041 | USA
T +1 713 839 9656 | F +1 713 827 3807
Logan.Ratner@Emerson.com
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
usage of Posix timers titusabraham Programming 5 10-13-2009 06:13 PM
System time getting affected...? deostroll Ubuntu 3 01-10-2008 06:13 PM
Posix timers not behaving correctly sean04 Programming 1 10-07-2007 11:34 PM
posix timers mailsteam Programming 7 05-18-2007 11:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:42 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration