All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai] Native_skin_Alarm_reprogramming
@ 2013-01-23 16:40 Moustapha Bikienga
  2013-01-23 18:48 ` Gilles Chanteperdrix
  0 siblings, 1 reply; 2+ messages in thread
From: Moustapha Bikienga @ 2013-01-23 16:40 UTC (permalink / raw)
  To: xenomai

Hi.

Writing a periodic alarm tested program, I noticed that after 10 shot, the
alarm wasn't reprogramming (or some thing else!).
Is there any reason for this ?

Best regards

Configuration :
xenomai : 2.6.0
Linux kernel : 2.6.38
---------------------
My program
#include <sys/mman.h>
#include <native/task.h>
#include <native/alarm.h>
#include <native/timer.h>

RT_ALARM alarm_desc;
RT_TASK server_desc;

void alarm_server(void *cookie){
int i;
i=0;
while(1){
rt_alarm_wait(&alarm_desc);
printf("SHOTED %d \n",i);
i++;
}
}
int main(int argc, char *argv[]){
int err;
mlockall(MCL_CURRENT|MCL_FUTURE);
err=rt_alarm_create(&alarm_desc,"MyAlarm");
err=rt_alarm_start(&alarm_desc,100000000,10000000);
err=rt_task_create(&server_desc,"myAlarmServer",0,5,0);
if(!err) rt_task_start(&server_desc,&alarm_server,NULL);
return 0;
}
-----------------------

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

* Re: [Xenomai] Native_skin_Alarm_reprogramming
  2013-01-23 16:40 [Xenomai] Native_skin_Alarm_reprogramming Moustapha Bikienga
@ 2013-01-23 18:48 ` Gilles Chanteperdrix
  0 siblings, 0 replies; 2+ messages in thread
From: Gilles Chanteperdrix @ 2013-01-23 18:48 UTC (permalink / raw)
  To: Moustapha Bikienga; +Cc: xenomai

On 01/23/2013 05:40 PM, Moustapha Bikienga wrote:

> Hi.
> 
> Writing a periodic alarm tested program, I noticed that after 10 shot, the
> alarm wasn't reprogramming (or some thing else!).

> Is there any reason for this ?

If you pause() the main thread before returning 0, it will survive many
more shots ;-)
-- 
                                                                Gilles.


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

end of thread, other threads:[~2013-01-23 18:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-23 16:40 [Xenomai] Native_skin_Alarm_reprogramming Moustapha Bikienga
2013-01-23 18:48 ` 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.