Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!snorkelwacker!bloom-beacon!eru!hagbard!sunic!mcsun!unido!fauern!sun1.ruf.uni-freiburg.de!ulnie From: ulnie@sun1.ruf.uni-freiburg.de (Ulf Niesar) Newsgroups: comp.os.os2.misc Subject: Re: HPFS ... (corrected) Keywords: HPFS cache UPS Message-ID: <1990Sep22.175529.22645@sun1.ruf.uni-freiburg.de> Date: 22 Sep 90 17:55:29 GMT Distribution: comp Organization: Rechenzentrum der Universitaet Freiburg, Deutschland Lines: 62 15123@sun1.ruf.uni-freiburg.de> <57468@microsoft.UUCP> gordonl@microsoft.UUCP (Gordon LETWIN) writes: >Individual users can easily write programs to monitor the UPS signal and >to send a power fail pending notification to their apps for shutdown; >all that we're missing here is that the OS doesn't provide the monitor >app (it's pretty trivial) and we don't define the convention for what >a power failing signal looks like... In my original contribution I probably didn't make my point clear enough. (sorry, I had to use the ID ulrich.seifert since I didn't have access to the newsgroup myself at that time) The situation that I had in mind was the following. Let us assume we have a power fault. Well, everything is O.K. if the user sits in front of the machine and can shutdown everything before the batteries are going low. But the price you have to pay is quite high. First of all you have to assume that there is a user around (for example in my case the computer is running quite often numerical intensive computations in the background while I am busy with something else). Secondly, you have to get a quite powerful UPS since you have to keep the whole computer (including monitor) running for some time. Why is this? Well, if we put a power monitor into the system, the only message it can send to a (commercially bought) app is a WM_QUIT message. And I bet that most of the programs will come up with a dialog window asking you if you are really sure that you want to quit. This is the point now. You really have to sit in front of the computer otherwise the machine is likely to die with the question on the screen if you are really sure to leave the program. (Probably a nice fealing if you see that happening!) On the other hand if we have a kind of shutdown_message a program could really clean up everything and maybe write a restart file or whatever is a useful thing to do. If such a message is standardized probably all programs will use it in some way and the user is sure that his machine performs a shutdown without any loss of data. In fact, this can have an effect on the cost for an UPS. Now we don't have to connect the monitor with the UPS and it might be sufficient to put one of these new UPS cards into an empty slot and if the power really fails you have the battery for a very short period of time (which makes it unexpensive and small) but you are still sure that the system powers down nicely. All this can always be done with an application where you have the source available with a home made monitor for the power supply. But I think there is no chance with a commercial product. (And I really don't want to code everything myself) In my opinion it is really a good idea to install such a service inside the operating system. It would be even better if the OS would write a restart kind of file itself in case of a power fault and restart the active applications when the power is back. This could be done with a kind of standard option in order to indicate that the application is requested to read it's restart informations and to perform all the necessary operations to come back to the point where it was when the fault happened. By the way this could also be used for users who like to see the computer coming up at the point where they switched it off. Right now I think that such a protocol of sending an extra shutdown message to an application is a better idea than having OS freeze the state of the computer. Probably it is much easier for an application to handle some broken communications or other unpleasent things than for an OS. What about that? Stupid or not? Ulf