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
For example,
If a process that failed due to a memory access violation, then control
goes to exception routine which will abort the process and restart.i.e)
without shutting down the entire system, it simply restarts that
process. Like
embedded control systems often employ these "partial restart"
approaches to surviving intermittent software failures without the
operators experiencing any system "downtime" or even being aware of
these quick-recovery software failures. Since the dumpfiles are
available, the developers of the software can detect and correct
software problems without having to deal with the emergencies that
result when critical systems fail at inconvenient times. During
termination, all the resources utilized by the process will be freed
except PID and etc.. which will remain same after process restart.
Thanks,
Bala
HCL-Cisco ODC,
Chennai.
Try this:
http://www.bluedonkey.org/cgi-bin/twiki/bin/view/Books/VxWorksCookbookTheKernel#Restarting_a_Task
VG
Actually, I too have questions about taskRestart()rather than answers.
We plan to use it to restart a background task when new data arrives
that should be processed. It won't matter if the currently running
task gets interrupted, in our case, since any data that would be
generated from that running of the task would be ignored in light of
the new data.
My question is if anyone knows how long taskRestart( ) takes to
execute? If we take too big of a time hit by using this option we're
going to have to come up with an alternative.
Thanks in advance,
m. parker
It will be executed from the starting point.
>
> Incase it starts executing from scratch from the place where its
> spawned,will it not cause problems to my application?
No, it will not cause any problem. During termination, resouces will be
freed.
>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.
I don't know why you get confused with this. task_restart is nothing
but you are going to execute a task from the entry point. So, during
execution of the process, resouces like semaphore,IO devies and etc
will be utilized. If it owned by some other process, still, it can wait
and get it. That's what we use realtime kernel in which priority
inheritance is possible.So even resources are utilized by other
processes, it is possible to get it soon.
>
> In precise can someone clarify me how this taskRestart() call
> work?Under what situations its preferred to use this call?
I have replied to this question in my previous mail.
>What are the
> pros and cons of using this call in our application?
Cons will be,
Critical/Driver level process may be put into wait state for a long
time which is not advisible, if the resouces are utilized by some other
process. Even for this, We can very well design the application in such
away that the situation can be avoided.
Hope, it might help.
Thanks,
Balakumar