All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philippe Gerum <rpm@xenomai.org>
To: Jan Kiszka <jan.kiszka@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] Problems with rt_task_wait_period
Date: Mon, 07 Aug 2006 16:13:28 +0200	[thread overview]
Message-ID: <1154960008.4322.8.camel@domain.hid> (raw)
In-Reply-To: <44D74405.7000900@domain.hid>

On Mon, 2006-08-07 at 15:45 +0200, Jan Kiszka wrote:
> Steve Kreyer wrote:
> > Hi,
> > 
> > Iam new to xenomai. 
> > For warming up I try to run this little test program:
> > 
> > -----------------------------------------------------------------------
> > #include <native/task.h>
> > #include <stdio.h>
> > #include <sys/mman.h>
> > 
> > RT_TASK task1;
> > 
> > void rt_task1(void* user_data){
> >     int err = 0;
> >     printf("%d\n", rt_task_set_periodic(NULL, TM_NOW, 100));
> 
> You are running in one-shot mode, thus all time units are in
> *nanoseconds*. 100 ns cycles tend to pass quite quickly, thus the setup
> actually fails (but it doesn't report this - a corner case for
> considering this a bug).

The setup does not really fail, but the period is so short that the tick
occurs before the task has a chance to wait for the first release point
in the timeline, so rt_task_wait_period() notices that no timer is
outstanding, but incorrectly concludes that no timer was ever armed.

> 
> >     err = rt_task_wait_period(NULL);
> >     if(err){
> >         fprintf(stderr, "Cannot wait periodic: %d, %d\n", err, EWOULDBLOCK);
> > 
> >     }
> > }
> > 
> > int main(){
> >     char* task1_data = NULL;
> >     mlockall(MCL_CURRENT|MCL_FUTURE);
> >     rt_timer_set_mode(TM_ONESHOT);
> >     rt_task_spawn(&task1, "task1", 0, 99, 0, rt_task1, &task1_data);
> >     sleep(10);
> >     rt_task_delete(&task1);
> >     return 0;
> > }
> > -----------------------------------------------------------------------
> > 
> > But rt_task_wait_period gives me always the Error EWOULDBLOCK, which means that I did not set the task periodic
> > but which in fact I did... The call to rt_task_set_periodic is succesful.
> > Can anyone help me figure out why? If you need additional infos please let me know...
> > 
> > Thanks in advance!
> > 
> > Steve
> > 
> 
> Jan
> 
> _______________________________________________
> Xenomai-help mailing list
> Xenomai-help@domain.hid
> https://mail.gna.org/listinfo/xenomai-help
-- 
Philippe.




  reply	other threads:[~2006-08-07 14:13 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-07 13:05 [Xenomai-help] Problems with rt_task_wait_period Steve Kreyer
2006-08-07 13:45 ` Jan Kiszka
2006-08-07 14:13   ` Philippe Gerum [this message]
2006-08-07 14:17     ` Jan Kiszka
2006-08-07 14:35       ` Philippe Gerum
2006-08-07 15:24       ` Philippe Gerum
  -- strict thread matches above, loose matches on Subject: below --
2006-08-07 14:34 Steve Kreyer
2006-08-07 14:42 Steve Kreyer
2006-08-07 15:27 ` Jan Kiszka
2006-08-07 15:32 ` Philippe Gerum

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1154960008.4322.8.camel@domain.hid \
    --to=rpm@xenomai.org \
    --cc=jan.kiszka@domain.hid \
    --cc=xenomai@xenomai.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.