* [Xenomai-help] difference between "alarm_wait" and "task_wait_period"
@ 2008-04-01 10:59 Mouaiad Alras
2008-04-09 15:21 ` Gilles Chanteperdrix
0 siblings, 1 reply; 2+ messages in thread
From: Mouaiad Alras @ 2008-04-01 10:59 UTC (permalink / raw)
To: xenomai
Hello,
is there any difference between "periodic task" and "periodic alarm
triggered task" ??
are "task1" and "task2" the same in this example ? :
void task1_do(void *cookies){
while(1){
rt_alarm_wait(&alarm1);
......
}
}
int main(void){
......
rt_alarm_create(&alarm1,"alarm1");
rt_task_create(&task1,"task1",_STK,_PRIO,_MOD);
rt_task_start(&task1, &task1_do, NULL);
rt_alarm_start(&alarm1,_OFFSET,_INTERVAL);
......
}
===================================
void task2_do(void *cookies){
while(1){
rt_task_wait_period(&task2);
......
}
}
int main(void){
......
rt_task_create(&task2,"task2",_STK,_PRIO,_MOD);
rt_task_set_periodic(&task2,_OFFSET,_INTERVAL);
rt_task_start(&task2, &task2_do, NULL);
......
}
thank you,
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Xenomai-help] difference between "alarm_wait" and "task_wait_period"
2008-04-01 10:59 [Xenomai-help] difference between "alarm_wait" and "task_wait_period" Mouaiad Alras
@ 2008-04-09 15:21 ` Gilles Chanteperdrix
0 siblings, 0 replies; 2+ messages in thread
From: Gilles Chanteperdrix @ 2008-04-09 15:21 UTC (permalink / raw)
To: Mouaiad Alras; +Cc: xenomai
Mouaiad Alras wrote:
> Hello,
> is there any difference between "periodic task" and "periodic alarm
> triggered task" ??
>
> are "task1" and "task2" the same in this example ? :
No, these are two ways to do the same thing. A periodic task uses a
timer that is built-in the task, whereas an alarm creates a different
timer. Of course, you can create as many alarms as you want whereas each
task has only one built-in timer.
--
Gilles.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-04-09 15:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-01 10:59 [Xenomai-help] difference between "alarm_wait" and "task_wait_period" Mouaiad Alras
2008-04-09 15:21 ` 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.