Page 1 of 1

I could like to know the role of “Idle task” in NNDK5272

Posted: Wed Apr 07, 2010 2:16 am
by kumarjosh
Currently application is crashing if I do not create an “Idle task”.
Please let me know the reasons?

Re: I could like to know the role of “Idle task” in NNDK5272

Posted: Wed Apr 07, 2010 3:33 am
by yevgenit
Idle task in non-avoidable component of any multitasking environment.
kumarjosh wrote:Currently application is crashing if I do not create an “Idle task”.
Please let me know the reasons?

Re: I could like to know the role of “Idle task” in NNDK5272

Posted: Wed Apr 07, 2010 5:48 am
by gavinm
The Idle Task (priority 63 ie lowest priority), is what the uC/OS scheduler will run if all other tasks are in a blocking state. Ie it's what the system will run if there's nothing else of higher priority needing to run.
I didn't know you could delete the Idle Task! It's a "must have".

Read the Netburner Programming Manual (NNDKProgMan.pdf) section on "UC/OS REAL-TIME OPERATING SYSTEM".
Here's a brief extract :
Lets say you have two tasks: A and B. Task A has priority 50 and Task B has priority 51. Since Task A is of higher priority, it will always run (and Task B will never run) unless it calls a blocking function. Task B will then run for as long as Task A blocks; this could be 1 second due to a call to OSTimeDly(TICKS_PER_SECOND), until a shared resource is available due to a call to OSSemPend(), or until data is available from a network connection due to a
select( ) call. If both tasks were in a blocking state, then the idle task (63) would run.
I hope this helps ...

Re: I could like to know the role of “Idle task” in NNDK5272

Posted: Wed Apr 07, 2010 6:38 am
by kumarjosh
yevgenit wrote:Idle task in non-avoidable component of any multitasking environment.
kumarjosh wrote:Currently application is crashing if I do not create an “Idle task”.
Please let me know the reasons?
Thanks yevgenit.
I have understands the use of the “Idle Task” through the “NNDKProgMan.pdf” document.
However I am not able understand that without this task system/application is going to crash.
I think the “Vxworks” runs without the idle task.

Re: I could like to know the role of “Idle task” in NNDK5272

Posted: Wed Apr 07, 2010 6:42 am
by kumarjosh
gavinm wrote:The Idle Task (priority 63 ie lowest priority), is what the uC/OS scheduler will run if all other tasks are in a blocking state. Ie it's what the system will run if there's nothing else of higher priority needing to run.
I didn't know you could delete the Idle Task! It's a "must have".

Read the Netburner Programming Manual (NNDKProgMan.pdf) section on "UC/OS REAL-TIME OPERATING SYSTEM".
Here's a brief extract :
Lets say you have two tasks: A and B. Task A has priority 50 and Task B has priority 51. Since Task A is of higher priority, it will always run (and Task B will never run) unless it calls a blocking function. Task B will then run for as long as Task A blocks; this could be 1 second due to a call to OSTimeDly(TICKS_PER_SECOND), until a shared resource is available due to a call to OSSemPend(), or until data is available from a network connection due to a
select( ) call. If both tasks were in a blocking state, then the idle task (63) would run.
I hope this helps ...
Thanks gavinm.
I have not found any documentation saying that this task is must!
Why the application is crashing without this task.
Could you have any idea?

Re: I could like to know the role of “Idle task” in NNDK5272

Posted: Wed Apr 07, 2010 6:59 am
by ckoehler
It's only logical. I don't know that you can expect to always have something going on, with none of your tasks ever blocking or not doing anything. The OS needs something to run then: the idle task.