From mboxrd@z Thu Jan 1 00:00:00 1970 Subject: Re: [Xenomai-help] Problems with rt_task_wait_period From: Philippe Gerum In-Reply-To: <44D74B8E.5050309@domain.hid> References: <1903678222@domain.hid> <44D74405.7000900@domain.hid> <1154960008.4322.8.camel@domain.hid> <44D74B8E.5050309@domain.hid> Content-Type: text/plain Date: Mon, 07 Aug 2006 17:24:35 +0200 Message-Id: <1154964276.4322.22.camel@domain.hid> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Reply-To: rpm@xenomai.org List-Id: Help regarding installation and common use of Xenomai List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka Cc: xenomai@xenomai.org On Mon, 2006-08-07 at 16:17 +0200, Jan Kiszka wrote: > Philippe Gerum wrote: > > 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 > >>> #include > >>> #include > >>> > >>> 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. > > Mmh, wouldn't the box simply lock up if the setup succeeded? It's a > periodic timer... :-> What I meant is that there is nothing in xnpod_set_thread_periodic() that actually checks if the settings are valid in the idate == XN_INFINITE case, therefore the setup never formally fails. > > Jan > -- Philippe.