AnsweredAssumed Answered

FIFO Scheduling and using the _time_delay()

Question asked by Ray Sgroi on Jan 24, 2012
Latest reply on Jan 25, 2012 by David E Seymour

Hello! I'm about 2-3 months into using Freescale Coldfire and MQX
My question is simple, hopefully...
Here is my setup info:

/* Task number, Entry point, Stack, Pri, String, Auto? */
{MAIN_TASK, Main_task, 2000, 9, "main", MQX_AUTO_START_TASK},
{COMMS_TASK, rs232_task, 1000, 10, "rs232", 0, 0, 0},
{TCP_TASK, TCP_task, 1000, 10, "tcpt", 0, 0, 0},
{UDP_TASK, UDP_task, 1000, 10, "udpt", 0, 0, 0},
{0, 0, 0, 0, 0, 0, }};

The Main task creates the RS232 task, TCp task and UDP task, that is all it does.
The RS232 I've configured as ISR based, so there is a 128 byte buffer to catch data, (I changed the original 64)
I assume there are also buffers with the sockets.
Each task uses an infinite while(1) loop with a non blocking recv(), so, I add a _time_delay(250)


When the task encounters the _time_delay(xxx) it proceeds to cleanup, storing the task info, and putting it in a delay queue, per the MQXUG...
However, it will NOT become Active again after 250, rather it will be placed AT THE BACK of the FIFO queue since all are the same priority...Am I correct in this assumption?
If this is true, it is not necessary to for me to use such a long time delay, 10 ms would be enough to quit running and go to the next task in the FIFO

Thanks for looking!

Ray

Outcomes