How to task migration ? - VxWorks

This is a discussion on How to task migration ? - VxWorks ; Hi All, There is some trouble in Task1,I want to copy information of Task1 to Task2, then kill Task1 and activate Task2. I donot known how to copy WIND_TCB of Task1 to Task2,and which information is necessary for Task2. Highly ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: How to task migration ?

  1. How to task migration ?

    Hi All,

    There is some trouble in Task1,I want to copy information of Task1
    to Task2, then kill Task1 and activate Task2. I donot known how to
    copy WIND_TCB of Task1 to Task2,and which information is necessary for
    Task2.

    Highly appreciate your response.


  2. Re: How to task migration ?

    On Jun 26, 2:53 pm, "yang5...@gmail.com" wrote:
    > Hi All,
    >
    > There is some trouble in Task1,I want to copy information of Task1
    > to Task2, then kill Task1 and activate Task2. I donot known how to
    > copy WIND_TCB of Task1 to Task2,and which information is necessary for
    > Task2.
    >
    > Highly appreciate your response.


    Hi,
    I doubt you would be able to do this.Copying one task information to
    another task(and incase the information is context info like TCB) is a
    recipe for disaster.When you say first task having problem,I dont see
    the good reason to take back up for next task other then for analysing
    purpose.

    Regards,
    s.subbarayan


  3. Re: How to task migration ?

    On 6 27 , 10 03 , ssubbarayan wrote:
    > On Jun 26, 2:53 pm, "yang5...@gmail.com" wrote:
    >
    > > Hi All,

    >
    > > There is some trouble in Task1,I want to copy information of Task1
    > > to Task2, then kill Task1 and activate Task2. I donot known how to
    > > copy WIND_TCB of Task1 to Task2,and which information is necessary for
    > > Task2.

    >
    > > Highly appreciate your response.

    >
    > Hi,
    > I doubt you would be able to do this.Copying one task information to
    > another task(and incase the information is context info like TCB) is a
    > recipe for disaster.When you say first task having problem,I dont see
    > the good reason to take back up for next task other then for analysing
    > purpose.
    >
    > Regards,
    > s.subbarayan




    The setjmp and longjmp may supply some "CheckPoint",the Task could use
    it. If the Task is dead,then the "CheckPoint" wouldnot be used for
    resuming the Task.
    Copying the Task1 information to anther Task may be a good idea, when
    the Task1 is dead. How to get the information from the stack of Task1?
    Now I read some papers about the MMU of VxWorks,in the fact I donot
    known how to do in this week.
    Will you please give me some suggestions?

    Best withes,
    Yang.


  4. Re: How to task migration ?

    On Jun 27, 7:41 pm, "yang5...@gmail.com" wrote:
    > On 6 27 , 10 03 , ssubbarayan wrote:
    >
    >
    >
    >
    >
    > > On Jun 26, 2:53 pm, "yang5...@gmail.com" wrote:

    >
    > > > Hi All,

    >
    > > > There is some trouble in Task1,I want to copy information of Task1
    > > > to Task2, then kill Task1 and activate Task2. I donot known how to
    > > > copy WIND_TCB of Task1 to Task2,and which information is necessary for
    > > > Task2.

    >
    > > > Highly appreciate your response.

    >
    > > Hi,
    > > I doubt you would be able to do this.Copying one task information to
    > > another task(and incase the information is context info like TCB) is a
    > > recipe for disaster.When you say first task having problem,I dont see
    > > the good reason to take back up for next task other then for analysing
    > > purpose.

    >
    > > Regards,
    > > s.subbarayan

    >
    > The setjmp and longjmp may supply some "CheckPoint",the Task could use
    > it. If the Task is dead,then the "CheckPoint" wouldnot be used for
    > resuming the Task.
    > Copying the Task1 information to anther Task may be a good idea, when
    > the Task1 is dead. How to get the information from the stack of Task1?
    > Now I read some papers about the MMU of VxWorks,in the fact I donot
    > known how to do in this week.
    > Will you please give me some suggestions?
    >
    > Best withes,
    > Yang.- Hide quoted text -
    >
    > - Show quoted text -


    Yang,

    You can use taskTcb to get the TCB of task1 and use
    taskRegsSet( ) and taskRegsGet( ) to copy the register contents to
    task2.

    HTH,
    ~Ramsen.

    taskTcb( )
    NAME
    taskTcb( ) - get the task control block for a task ID

    SYNOPSIS

    WIND_TCB *taskTcb
    (
    int tid /* task ID */
    )
    DESCRIPTION
    This routine returns a pointer to the task control block (WIND_TCB)
    for a specified task. Although all task state information is contained
    in the TCB, users must not modify it directly. To change registers,
    for instance, use taskRegsSet( ) and taskRegsGet( ).


    RETURNS
    A pointer to a WIND_TCB, or NULL if the task ID is invalid.


    ERRNO
    S_objLib_OBJ_ID_ERROR

    SEE ALSO
    taskLib


+ Reply to Thread