How does this task get scheduled - VxWorks

This is a discussion on How does this task get scheduled - VxWorks ; Hi, In some codes, I see taskA was spawned, then suspended. But not see of the explicitly calling of taskResume() or taskActivate() to change taskA's status from "suspended" to "ready" status. So, the question is how taskA got scheduled... TaskA::Create() ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: How does this task get scheduled

  1. How does this task get scheduled

    Hi, In some codes, I see taskA was spawned, then suspended. But not see
    of the explicitly calling of taskResume() or taskActivate() to change
    taskA's status from "suspended" to "ready" status. So, the question is
    how taskA got scheduled...

    TaskA::Create()
    {
    taskId = taskSpawn( const_cast( name ),
    Priority_A,
    0, // No options yet <<<
    stackSize_A,
    entry,
    ,...);

    taskSuspend(taskId);
    ...
    }

    I also see in entry(), there is a directly calling of main() loop
    function of taskA. Will this calling trigger status from "suspended" to
    be "ready"?


  2. Re: How does this task get scheduled


    jeanwelly wrote:
    > Hi, In some codes, I see taskA was spawned, then suspended. But not see
    > of the explicitly calling of taskResume() or taskActivate() to change
    > taskA's status from "suspended" to "ready" status. So, the question is
    > how taskA got scheduled...
    >
    > TaskA::Create()
    > {
    > taskId = taskSpawn( const_cast( name ),
    > Priority_A,
    > 0, // No options yet <<<
    > stackSize_A,
    > entry,
    > ,...);
    >
    > taskSuspend(taskId);
    > ...
    > }
    >
    > I also see in entry(), there is a directly calling of main() loop
    > function of taskA. Will this calling trigger status from "suspended" to
    > be "ready"?


    Jean,
    Unless you call taskResume() a suspended task cant be invoked back.The
    idea would be to start the task at some other point of time instead
    when its spawned.
    Regards,
    s.subbarayan


+ Reply to Thread