Application monitor
David Feugey (2125) 2709 posts |
Some ideas for the tools that manage applications: 1/ a very easy one 1/ an almost easy one 2/ a not so easy one 3/ a hard one? The idea of course is to have a non stop system. IMHO, a good alternative to memory protection. |
Rick Murray (539) 13840 posts |
Hmmm, that explains why I need to cycle the list of applications to kill a crashed one. Looking at the code (…Sources.Desktop.Wimp.s.Watchdog), it looks as if it starts with task #0 and just steps through the list that TaskManager knows about. As the list loops around, I don’t see any specific problem with inserting some code to read the handle of the current task.
Wouldn’t it just? It is harder to achieve in practice. For example, your application pops up an error message that the user should respond to. We’re multitasking because of nice multitasking error messages, right, but… What happens when the user decides instead to click on your iconbar icon and/or call up a menu? I have written a multitasking error system for one of my applications. It works well, but it consists of numerous interlocks to disable parts of the app functionality when we are in an “error state” but keep enough of it alive to permit the system to continue to operate sensibly.
True. But on the other hand – ever come across crashed applications under Windows? Sometimes you’ll get a big empty window on-screen that you can’t close, can’t move, can’t get out of the way. Helpfully, Ctrl-Alt-Delete brings up a nifty little task manager that appears to ask applications “nicely” if they can quit. Asking nicely is no damn good if the app has crashed. You just have to hope that Windows notices that it is “not responding” and actually offers you an option to kill off the errant task.
If you have multiple crashed applications at the same time, you’re probably a developer… or you went on holiday and left your machine running.
I wrote a reincarnation server for RISC OS 3.10 a long long time ago (to deal with BBS crashes). It isn’t hard, you need a module task to match application names to task handles (Wimp message &400C2) and then pay attention to Task dying messages (Wimp message &400C3) and if you get a match, record it, idle-poll a few times (wait for the app to quit), then restart it.
What do you consider to be a crash? The Wimp having been frozen for a while? Press F12. I recall Jeffrey and I having this discussion earlier in the year that it is obvious to us when an application crashes, but it isn’t necessarily so easy to deal with this programmatically.
:-) This ain’t Linux!
No, nothing is a good alternative to memory protection. Having a non-stop system is something to aim for, but is not always necessarily possible. A few weeks back, my website host was down – responding to nothing (not even pings). Last night, streaming the first episode of Sabagabu! (v. funny!) to my iPad caused it to freeze and reboot. Watching it again, all was okay. Point is – sometimes things get their panties in a twist and fall over. What we can do is attempt to make our systems more resilient; but we must also strive for better resilience in applications as well. |
David Feugey (2125) 2709 posts |
True, but modal windows could be tweak to block the user interface but not to block the tasks. Today it’s like pressing F12: it blocks all applications.
Could be a good start for a FilerRun_NonStop command :) Useful for server software.
Today, for example, mouse was not moving and all applications were blocked. |
David Feugey (2125) 2709 posts |
Nota: I’m not against memory protection, but ARM has to few zones (4?). Today, when you switch to one application, you need to define a new zone for its memory. Long and heavy process. Perhaps that to define a few zones (data for system / applications / modules / rma) would be enough to make the system more reliable. |
David Feugey (2125) 2709 posts |
I tried all the tools. Works great. Server does not freeze anymore. But WebJames still hangs sometimes. Do you still have the reincarnation server? |