how to create another task without help of current running task

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

how to create another task without help of current running task

跳至解决方案
830 次查看
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..


标签 (1)
0 项奖励
回复
1 解答
720 次查看
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 项奖励
回复
1 回复
721 次查看
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 项奖励
回复