how to create another task without help of current running task

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

how to create another task without help of current running task

Jump to solution
513 Views
sudhakarp
Contributor V

i want to listen 2port simultaneously. can you give any solution for this..?

i tried example rtcs project code but i cant listen two port at the same time.after one client connected only it was processing another one. how to listen 2port or how to initialize 2port at a same time

example code:

err = select(2,&rfds,NULL,0);

test_tid = _task_create(0, TEST_TASK_INDEX, (uint32_t) &task_p);

                         if (tx_tid == MQX_NULL_TASK_ID)

                         {

                             fprintf(stderr, "Fatal Error 0x%X: Unable to create transmit task.", _task_get_error());

                             _task_block();

                         }

    

actually "select(2,&rfds,NULL,0);" in  this function was waiting upto incoming connection.

after that only its creating TEST_TASK_INDEX,  so how to avoid that problem. how to create another task without help of current running task. i am new for RTOS now only i am learning, i am waiting for your  reply..


Labels (1)
0 Kudos
Reply
1 Solution
403 Views
soledad
NXP Employee
NXP Employee

Hello,

In the task template list contains the information of the attributes of tasks that MQX creates, and it could be any combination of:

  • NULL: When MQX starts, it does not create an instance of the task. MQX uses FIFO scheduling for the task.
  • MQX_AUTO_START_TASK: When MQX starts, it creates one instance of the task.
  • MQX_DSP_TASK: MQX saves the DSP coprocessor registers as part of the task’s context.
  • MQX_FLOATING_POINT_TASK: MQX saves floating-point registers as part of the task’s context.

So if all the tasks have as attribute MQX_AUTO_START_TASK then the tasks will run without help of another task. MQX uses FIFO scheduling for the task.

Have a great day,
Sol

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
Reply
1 Reply
404 Views
soledad
NXP Employee
NXP Employee

Hello,

In the task template list contains the information of the attributes of tasks that MQX creates, and it could be any combination of:

  • NULL: When MQX starts, it does not create an instance of the task. MQX uses FIFO scheduling for the task.
  • MQX_AUTO_START_TASK: When MQX starts, it creates one instance of the task.
  • MQX_DSP_TASK: MQX saves the DSP coprocessor registers as part of the task’s context.
  • MQX_FLOATING_POINT_TASK: MQX saves floating-point registers as part of the task’s context.

So if all the tasks have as attribute MQX_AUTO_START_TASK then the tasks will run without help of another task. MQX uses FIFO scheduling for the task.

Have a great day,
Sol

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply