Self restarting property of RTOS-How it works?

s_subbarayan_at_rediffmail.com
Date: 02/07/05


Date: 6 Feb 2005 20:50:46 -0800

Dear all,
  I was going through the explaination for taskRestart() call in the
vxworks reference manual.I believe such a feature is available for most
of the RTOS in the market.This dicussion talks about vxworks,But it
applies in general for any rtos which offers a restarting facility.I am
looking for replys from a architecture perspective rather then os
specific discussion.

Vxworks reference manual for taskRestart() states the following:
"This routine "restarts" a task. The task is first terminated, and then
reinitialized with the same ID, priority, options, original entry
point, stack size, and parameters it had when it was terminated.
Self-restarting of a calling task is performed by the exception task.
The shell utilizes this routine to restart itself when aborted. "

I have never got a chance to use this call in my application,but
curious to learn how it works.Heres my doubt:

After restarting will the task start executing from the starting point
or will execute from where it left?(that means continue executing,from
the point where its terminated before restarting?).

Incase it starts executing from scratch from the place where its
spawned,will it not cause problems to my application?For eg,I am in
middle of some biomedical application and some task goes for a toss and
I restart it using this call,the task will start performing everything
from scratch which may not be suitable to the current status of
application(In terms of micro heart surgery,typically lets say the task
performing the cutting of tissues goes for a toss after some time,and I
restart,if it again starts cutting the tissues which is not required
for me,because I have already removed it!).

If its otherway around,for eg it starts executing from the point where
it got terminated,how does the task ensure it gets all the resources
like I/O device,semaphores or some other resource,which is required to
execute from the point where it was terminated?Because the time before
it restarts,may be there can be another high priority task which may
own the resources required by the current task and I feel this should
not be possible because it will cause problem to the entire
application.

In precise can someone clarify me how this taskRestart() call
work?Under what situations its preferred to use this call?What are the
pros and cons of using this call in our application?

Looking farward for your replys and advanced thanks for the same,

Regards,
s.subbarayan