All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-help] Newbie question : rt_timer_inquire and RT_TIMER_INFO precisions
@ 2007-03-21 14:01 RAKOTOSALAMA, Nirilanto
  2007-03-21 16:23 ` Gilles Chanteperdrix
  0 siblings, 1 reply; 2+ messages in thread
From: RAKOTOSALAMA, Nirilanto @ 2007-03-21 14:01 UTC (permalink / raw)
  To: xenomai

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.

Sorry for my bad english.

Thanks in advance.

Niry

This e-mail is intended only for the above addressee. It may contain privileged information.
If you are not the addressee you must not copy, distribute, disclose or use any of the information in it. 
If you have received it in error please delete it and immediately notify the sender.
Security Notice: all e-mail, sent to or from this address, may be accessed by someone other than the recipient, for system management and security reasons. This access is controlled under Regulation of security reasons.
This access is controlled under Regulation of Investigatory Powers Act 2000, Lawful Business Practises.




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Xenomai-help] Newbie question : rt_timer_inquire and RT_TIMER_INFO precisions
  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
  0 siblings, 0 replies; 2+ messages in thread
From: Gilles Chanteperdrix @ 2007-03-21 16:23 UTC (permalink / raw)
  To: RAKOTOSALAMA, Nirilanto; +Cc: xenomai

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-03-21 16:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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.