From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: "RAKOTOSALAMA, Nirilanto" <NIRILANTO.RAKOTOSALAMA@airbus.com>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] Newbie question : rt_timer_inquire and RT_TIMER_INFO precisions
Date: Wed, 21 Mar 2007 17:23:31 +0100 [thread overview]
Message-ID: <46015C03.2090006@domain.hid> (raw)
In-Reply-To: <5C40CD1E4697424ABDE3AC57CF1B22C603221027@domain.hid>
RAKOTOSALAMA, Nirilanto wrote:
> Hello !!!
> I'm total newbie in programming with xenomai (it's the purpose of my internship :-s) !
> I've to use xenomai to implement a timer library so, I would like some precisions about
> RT_TIMER_INFO type. After reading the API I've understood what the RTIME period field is
> but I ignore what are the RTIME date and tsc fields (meanings ?, time unit ?, time origin ?).
>
> Also, what is the difference between using rt_alarm_inquire and rt_timer_tsc ? I'd like to calulate
> elapsed time since the timer start for example.
Xenomai has two time sources: the sytem timer, which counts the number
of nanoseconds since 1970, and a hardware dependent high resolution
counter which counts the time since an unspecified point in time
(usually the system boot time). This hardware dependent high resolution
counter is called "tsc" on a PC, and gave its name to Xenomai native API
calls.
rt_timer_tsc returns the value of this hardware dependent
high-resolution counter.
rt_timer_info returns the same thing in the tsc member of the
RT_TIMER_INFO structure, and the value of the system timer at exactly
the same time as when the high-resolution counter was read.
This allows to have a correspondance between the two time sources.
rt_alarm_inquire is not related to this and returns some information
about a given alarm.
Now, if you allow me, a little advice for the implementation of a "timer
library": you could be tempted to create only one periodic alarm object
with Xenomai, and to manage a timer list yourself. Don't do this.
Creating an alarm object for each timer library object make Xenomai
aware of the existence of all your application timers, this has several
advantages:
- it gives you information about all your timers in /proc/xenomai
- it allows Xenomai to use its anticipation algorithm for all your timers
- if you are concerned about the scalability of Xenomai timers list
management, you can check the options in the "Scalability" menu of
Xenomai configuration menu ("Real-time subsystem" sub-menu of kernel
configuration menu).
--
Gilles Chanteperdrix
prev parent reply other threads:[~2007-03-21 16:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-21 14:01 [Xenomai-help] Newbie question : rt_timer_inquire and RT_TIMER_INFO precisions RAKOTOSALAMA, Nirilanto
2007-03-21 16:23 ` 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=46015C03.2090006@domain.hid \
--to=gilles.chanteperdrix@xenomai.org \
--cc=NIRILANTO.RAKOTOSALAMA@airbus.com \
--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.