All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-help] some questions about alarms
@ 2006-04-21 15:11 Tobias Marschall
  2006-04-22 10:08 ` Philippe Gerum
  0 siblings, 1 reply; 2+ messages in thread
From: Tobias Marschall @ 2006-04-21 15:11 UTC (permalink / raw)
  To: xenomai

Hello,

my application needs (besides doing some other stuff) to set some output 
signals on an interface card at specific points in time. I think such a 
simple thing doesn't deserve its own thread and am considering to use alarms 
for this.

Is it correct that the handler of an alarm is executed with the same priority 
as the thread that created it? Meaning that the alarm execution will be 
delayed if a higher-priority (primary mode) thread is running at the time the 
alarm expires?

In my case it would be most convenient to be able to program an alarm timer 
using an absolute time (date). I didn't find such a function in the API 
documentation (native skin). Is the absense of such a function intended or 
did simply nobody implement it? Is it possible to implement such a function 
by just modifying the native skin?

But perhaps there is a better way to solve my issue. Is there any "best 
practice" for my problem? By now I see to possibilities: 1) Use a 
rt_timer_read in connection with alarms. 2) Spawn a whole thread and use 
rt_task_sleep_until.

Any Ideas?

Best regards and thanks in advance,
Tobias


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

* Re: [Xenomai-help] some questions about alarms
  2006-04-21 15:11 [Xenomai-help] some questions about alarms Tobias Marschall
@ 2006-04-22 10:08 ` Philippe Gerum
  0 siblings, 0 replies; 2+ messages in thread
From: Philippe Gerum @ 2006-04-22 10:08 UTC (permalink / raw)
  To: Tobias Marschall; +Cc: xenomai

Tobias Marschall wrote:
> Hello,
> 
> my application needs (besides doing some other stuff) to set some output 
> signals on an interface card at specific points in time. I think such a 
> simple thing doesn't deserve its own thread and am considering to use alarms 
> for this.
> 
> Is it correct that the handler of an alarm is executed with the same priority 
> as the thread that created it? Meaning that the alarm execution will be 
> delayed if a higher-priority (primary mode) thread is running at the time the 
> alarm expires?
>

Alarms used in kernel context are run on behalf of the Xenomai timer ISR 
context. In user-space, real-time alarms are currently handled by server 
threads you create, which call the rt_alarm_wait() service to wait for 
the next alarm shot, then process the timeout from their own context. As 
a side-effect, this service boosts the calling thread priority above all 
regular Xenomai threads, i.e. to some kind of pseudo-interrupt level.

> In my case it would be most convenient to be able to program an alarm timer 
> using an absolute time (date). I didn't find such a function in the API 
> documentation (native skin). Is the absense of such a function intended or 
> did simply nobody implement it? Is it possible to implement such a function 
> by just modifying the native skin?
> 

Yes, but I don't think that alarms are the most appropriate feature to 
use in your case. Alarms are basically provided for setting watchdogs 
that would handle timeout conditions.

> But perhaps there is a better way to solve my issue. Is there any "best 
> practice" for my problem? By now I see to possibilities: 1) Use a 
> rt_timer_read in connection with alarms. 2) Spawn a whole thread and use 
> rt_task_sleep_until.
>

Spawning a thread and use rt_task_set_periodic()+rt_task_wait_period() 
would be better here. You would be able to specify an absolute starting 
date, and a fixed period.

> Any Ideas?
> 
> Best regards and thanks in advance,
> Tobias
> 
> _______________________________________________
> Xenomai-help mailing list
> Xenomai-help@domain.hid
> https://mail.gna.org/listinfo/xenomai-help
> 


-- 

Philippe.


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

end of thread, other threads:[~2006-04-22 10:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-21 15:11 [Xenomai-help] some questions about alarms Tobias Marschall
2006-04-22 10:08 ` Philippe Gerum

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.