From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Richard Cochran <richardcochran@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-core] Realtime gettimeofday()
Date: Tue, 15 Dec 2009 16:07:24 +0100 [thread overview]
Message-ID: <4B27A62C.2050300@domain.hid> (raw)
In-Reply-To: <20091215150008.GA10925@domain.hid>
Richard Cochran wrote:
> On Wed, Dec 02, 2009 at 02:23:39PM +0100, Gilles Chanteperdrix wrote:
>> This issue has been discussed several times, but never a lot. We have a
>> simple solution: starting with 2.4 (if I remember correctly) xenomai
>> provides clock_settime, so you can simply rely on clock_gettime, and
>> call clock_settime from time to time to resync the Xenomai clock with
>> Linux NTP-enhanced clock. This is not pretty, you get a drift increasing
>> over time, then suddenly been reset. But I guess this has been enough
>> for current users, until now. You control the maximum drift by how often
>> you call clock_settime.
>
> Well, it looks like I will need to use this method, too, until the
> "real" solution comes along. But that leaves me with more questions:
>
> 1. My program is written using the native skin, and I need to time
> stamp some data while in primary mode. Can I safely call the posix
> skin's clock_gettime() function from my native thread?
Yes.
>
> 2. I will need a non-critical thread to go the gettimeofday() -
> clock_settime() adjustment hack once in a while. Can I safely start a
> both a posix skin thread and a native thread from the same main
> program?
Yes. But you should better use __real_clock_gettime than gettimeofday,
since it returns a struct timespec which you may feed into clock_settime
without any further adjustments.
--
Gilles
prev parent reply other threads:[~2009-12-15 15:07 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-02 12:55 [Xenomai-core] Realtime gettimeofday() Wolfgang Mauerer
2009-12-02 13:23 ` Gilles Chanteperdrix
2009-12-02 13:43 ` Jan Kiszka
2009-12-02 14:15 ` Gilles Chanteperdrix
2009-12-02 14:31 ` Jan Kiszka
2009-12-02 14:35 ` Gilles Chanteperdrix
2009-12-02 14:55 ` Jan Kiszka
2009-12-02 15:03 ` Gilles Chanteperdrix
2009-12-02 15:16 ` Jan Kiszka
2009-12-02 16:08 ` Gilles Chanteperdrix
2009-12-02 16:23 ` Jan Kiszka
2009-12-02 16:59 ` Gilles Chanteperdrix
2009-12-02 20:54 ` Gilles Chanteperdrix
2009-12-02 22:03 ` Wolfgang Mauerer
2009-12-02 22:20 ` Gilles Chanteperdrix
2009-12-02 22:33 ` Gilles Chanteperdrix
2009-12-03 9:36 ` Wolfgang Mauerer
2009-12-03 10:50 ` Gilles Chanteperdrix
2009-12-03 13:11 ` Wolfgang Mauerer
2009-12-03 13:14 ` Gilles Chanteperdrix
2009-12-03 13:32 ` Wolfgang Mauerer
2009-12-03 13:38 ` Gilles Chanteperdrix
2009-12-03 20:31 ` Wolfgang Mauerer
2009-12-03 21:42 ` Gilles Chanteperdrix
2009-12-05 16:11 ` Philippe Gerum
2009-12-07 9:14 ` Jan Kiszka
2009-12-07 13:43 ` Gilles Chanteperdrix
2009-12-07 13:50 ` Jan Kiszka
2009-12-07 14:07 ` Philippe Gerum
2009-12-07 14:21 ` Wolfgang Mauerer
2009-12-15 15:00 ` Richard Cochran
2009-12-15 15:07 ` Gilles Chanteperdrix [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4B27A62C.2050300@domain.hid \
--to=gilles.chanteperdrix@xenomai.org \
--cc=richardcochran@domain.hid \
--cc=xenomai@xenomai.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.