Cannot find task id.

Joel Sherrill joel.sherrill at OARcorp.com
Thu Oct 24 12:06:31 UTC 2002



Niclas Johansson wrote:
> 
> On Thu, 24 Oct 2002, Ian Caddy wrote:
> 
> > Hi Niclas,
> >
> > Your application task does not stay in a loop, and hence will complete
> > straight away.
> >
> > In this case, your Application task will complete after the printf and
> > then will be deleted.
> >
> > Therefore if it is a higher priority task than your init task, it will
> > be deleted before your init task will to the last ident.
> >
> > To fix this you will need to add (to your application task)
> >
> > while(1)
> > {
> >     rtems_task_wkafter(100);
> > }
> >
> > Then it will not end.

Thanks for looking at that Ian.  I have had people in this week
for design reviews and barely answering email. :)

Another minor point on tasks/threads exiting.  The precise behavior
for a task falling out of its "main" routine is API dependent.  At
the current time, I believe that when you enable posix, you might
end up with automatic and silent deletion for all threads.  I recall
someone mentioning this as a weirdness.  As a general rule of thumb,
do explicit calls to rtems_task_delete(SELF) or pthread_exit()
to do it explicitly.

> > I hope this helps,
> >
> > Ian Caddy
> >
> It helps very much! Thank you
> for answering my stupid question! =)

-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel at OARcorp.com                 On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
Support Available                (256) 722-9985



More information about the users mailing list