Two Coding Problems

Ian Caddy ianc at goanna.iinet.net.au
Thu Jan 12 07:44:17 UTC 2006


Hi Sun Shine,

I think my theory still does hold up since when you use the suspend 
instead of delete in the init task, you are now re-using the T1 task ID, 
not the init task.  The T1 task also was deleted, since it would have 
gone off the end of it task.

As to why when you use suspend everywhere instead of falling off the end 
of the tasks, I suggest you check your definition for the number of 
tasks allowed in your system.  This is set by confdefs.h and can be 
overridden with a define before you include it in your init task:

#define CONFIGURE_MAXIMUM_TASKS              10

This should then allow you to have more tasks.  Did you actually check 
the return code from the task create, and did it say there were too many 
tasks created?

I hope this helps.

regards,

Ian Caddy




Sun Shine wrote:
> I don't think this can handle the problem.
> Use my code again, for example , T0 create T1 and T2,and T1 create T3 , 
> T2 create T4
> then the IDs are:
>   T0: a010001 (Init Task)
>   T1: a010002 (Created by T0)
>   T2: a010003 (Created by T0)
>   T3: a010004 (Created by T1)
>   T4: a010001 (Created by T2)
> If just like you said , the ID of T3 should be a010001 and the ID of T4 
> should be a010002, because T1 and T2 are non-existent.
> 
> And I also tried your method: use rtems_task_suspend(0) instead of 
> rtems_task_delete(0), in Init(), the result is:
>   T0: a010001
>   T1: a010002
>   T2: a010003
>   T3: a010004
>   T4: a010002
> 
> Then I use rtems_task_suspend(0) to replace rtems_task_delete(0) in all 
> the methods --- Init(),get_task_info() and create_task(),there comes the 
> problem: T4's creation will fail.
> 
> _________________________________________________________________
> 与联机的朋友进行交流,请使用 MSN Messenger:  http://messenger.msn.com/cn 

-- 
Ian Caddy
Goanna Technologies Pty Ltd
+61 8 9221 1860




More information about the users mailing list