Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

taskRestart() with vxworks-

391 views
Skip to first unread message

s.subbarayan

unread,
Feb 6, 2005, 11:46:26 PM2/6/05
to
Dear all,
I was going through the explaination for taskRestart() call in the
vxworks reference manual.It 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

Bala

unread,
Feb 7, 2005, 4:05:22 AM2/7/05
to
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.

s_subb...@rediffmail.com

unread,
Feb 7, 2005, 5:56:24 AM2/7/05
to
Hi,
Your reply does not answer me how restart works,rather it gives me
input why restart is required.Anyway thanks for your input.From your
input I infer this is mainly used only in debugging situations and
exceptional conditions which IMHO is known to me already.
Regards,
s.subbarayan

Vcc Ground

unread,
Feb 8, 2005, 5:59:20 AM2/8/05
to
"s_subb...@rediffmail.com" <s_subb...@rediffmail.com> wrote in message news:<1107773784....@c13g2000cwb.googlegroups.com>...

> Hi,
> Your reply does not answer me how restart works,rather it gives me
> input why restart is required.Anyway thanks for your input.From your
> input I infer this is mainly used only in debugging situations and
> exceptional conditions which IMHO is known to me already.
> Regards,
> s.subbarayan


Try this:
http://www.bluedonkey.org/cgi-bin/twiki/bin/view/Books/VxWorksCookbookTheKernel#Restarting_a_Task

VG

mparker

unread,
Feb 9, 2005, 9:06:37 AM2/9/05
to

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

Bala

unread,
Feb 11, 2005, 9:22:47 AM2/11/05
to

s.subbarayan wrote:
> Dear all,
> I was going through the explaination for taskRestart() call in the
> vxworks reference manual.It 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?).

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

REH

unread,
Feb 11, 2005, 1:09:35 PM2/11/05
to

"Bala" <bdur...@cisco.com> wrote in message
news:1108131767.0...@l41g2000cwc.googlegroups.com...

>
> > 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.
>
That's not entirely true. The memory allocate to the task for its TCB and
stack will be freed, but if the task has created files, sempahores, dynamic
memory, etc., these will not automatically be freed. If your code is not
smart enough to handle this, on a restart you will just allocate more and
create quite a memory leak.


0 new messages