Message-ID: <44597D0700060D0D@n120.sc0.cp.net> (added by postmaster@domain.hid) From: "Prashanti Bedapudi" Date: Fri, 5 May 2006 14:24:42 -0500 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0000_01C6704F.C7DACB50" In-Reply-To: Subject: [Xenomai-help] help with alarams List-Id: Help regarding installation and common use of Xenomai List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: xenomai@xenomai.org This is a multi-part message in MIME format. ------=_NextPart_000_0000_01C6704F.C7DACB50 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hi, I am new to xenomai and linux. I am having some problems with alarms. Here is a sample piece of code that I am using. If you look at the main function, I have a while(!quit_now) and I am setting this flag in the alarm_handler. I am seeing some weird results. When I have a printf statement in the while(!quit_now) loop as I have below, it works as expected and the program terminates when the quit_flag is set. But if I remove the printf() the program never terminates, it just hangs, even if the quit_now flag is set. Any insight into this problem will be greatly appreciated. alarm_handler() { for(;;) { rt_alarm_wait(); do_processing(); if(condition met) { quit_now = TRUE; /* global variable */ break; } } } main() { rt_alarm_create; rt_task_spawn(); rt_alarm_start(); while(!quit_now) printf("Inside while\n"); } thanks in advance, Shanti ------=_NextPart_000_0000_01C6704F.C7DACB50 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

 

Hi,

I am new to xenomai and linux. I am having some = problems with alarms. Here is a sample piece of code that I am = using.

If you look at the main function, I have a while(!quit_now)  and I am setting this flag in the alarm_handler. = I am seeing some weird results. When I have a printf statement in the while(!quit_now) loop as I have below, it works as expected and the = program terminates when the quit_flag is set. But if I remove the printf() the = program never terminates, it just hangs, even if the quit_now flag is set. =

Any insight into this problem will be greatly = appreciated.

 

 

alarm_handler()
=
{
        =
for(;;)
        =
{
        =
   rt_alarm_wait();
        =
   do_processing();
        =
   if(condition met)
        =
   {
       &nbs=
p;       quit_now =3D TRUE;  /* =
global variable */
       &nbs=
p;       =
break;
        =
   }
        =
}
}
 
main()
{
        =
rt_alarm_create;
        =
rt_task_spawn();
        =
rt_alarm_start();
 
        =
while(!quit_now)
        =
  printf("Inside =
while\n");
}
 

 

 

 

thanks in advance,

Shanti

------=_NextPart_000_0000_01C6704F.C7DACB50--