From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,f6ee8ca03c176d76 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-08-28 06:59:45 PST Newsgroups: comp.lang.ada Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!nntp.abs.net!uunet!dca.uu.net!ash.uu.net!world!news From: Robert A Duff Subject: Re: stupid question: how can I finish a program? Sender: news@world.std.com (Mr Usenet Himself) Message-ID: Date: Wed, 28 Aug 2002 13:59:25 GMT References: <5ee5b646.0208241822.34540e8b@posting.google.com> NNTP-Posting-Host: shell01.theworld.com Organization: The World Public Access UNIX, Brookline, MA X-Newsreader: Gnus v5.7/Emacs 20.7 Xref: archiver1.google.com comp.lang.ada:28495 Date: 2002-08-28T13:59:25+00:00 List-Id: Dmitry A.Kazakov writes: > For example? Abort without any defined clean-up warranties absolutely > nothing. > > Otherwise, some sort of "finalization" should be defined. For instance: > known tasks killed, known memory returned. But (1) any sort of finalization > could still hang up. If you're running under a proper operating system, then all resources visible outside the program will be cleaned up when the program exits. Therefore, there is no need for finalization to clean up such resources. (I'm talking about the Ada finalization here.) Certainly, "exit" will kill all tasks in the program and recover all memory. There is no need for finalization to clean up resources internal to the program, either -- the program is about to vanish. *Some* kinds of finalization might be broken by "exit". For example, if some Finalize routine flushes a buffer to disk, and you want that buffer flushed. So you can't blithely call "exit" without some global knowledge of how finalization is used in your program. If you're not using an operating system then the story is very different. >... (2) How to define it in a portable way (= in language > terms)? Seems pretty straightforward to me. Just define a feature that halts the program and doesn't run any finalization. In an embedded system, the appropriate implementation might be: <> goto Self; - Bob