Stable application (non-stop, non-hanging...)

  • Thread starter Thread starter Tod Johnson
  • Start date Start date
T

Tod Johnson

Hello all,

I'm wondering if anybody know how to implement for my application
something like watcher. I mean if application doesn't response on events
for a certain time then something'll kill it and run again. Are there
common approaches for this? The only thing that I can think out is to
create another process which will send messages for my application
window or to create shared resource where will be stored counter...

Thank you in advance,
Tod
 
Yes, create a separate watchdog process. From your main application "kick"
it (some prefer to say "stroke", "pet" etc) on a certain interval. If the
watchdog does not receive a kick within a certain interval, it takes the
action you specified as per your requirements (restart app, restart unit
etc). Your kick can simply be setting an event (check out the IPC post on my
blog for details on that); you should definitely do it from your main (UI)
thread and depending on your requirements do it from other threads too.

I have implemented the above for my app (again details on my blog) on our
CE-based unit. The watchdog is a C app which itself kicks the hardware
watchdog on our board. I will blog about the mechanism soon but the above
should be all you need.

Cheers
Daniel
 
Thank you Daniel fot your answer. Can you tell me the reason of C
watchdog? Why it can't be written on C# for CF.NET? And how could be
implemented IPC on CF.NET 1.0?
 
You can have a CF app watchdogging another CF app it is just my suggestion
that the dog is an eVC app. Why? Well it doesn't feel right to use CF for a
blind process (the dog doesn't have any GUI) which you want to be as light
as possible (you don't want to complicate it to the extent where you need a
dog for the dog) and which would mostly include pinvokes (waiting on event
in a loop, restarting process/unit).

Here is the direct link to my IPC blog entry (I guess I need a search
feature for my site):
http://www.danielmoth.com/Blog/2004/09/ipc-with-cf-on-ce-part-1.html
http://www.danielmoth.com/Blog/2004/09/ipc-with-cf-on-ce-part-2.html

I specifically suggest named events.

Cheers
Daniel
 
Back
Top