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,LOTS_OF_MONEY 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-17 00:56:43 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!diablo.theplanet.net!zen.net.uk!news.imp.ch!news.imp.ch!psinet-eu-nl!psiuk-p4!uknet!psiuk-p3!uknet!psiuk-n!news.pace.co.uk!nh.pace.co.uk!not-for-mail From: "Marin D. Condic" Newsgroups: comp.lang.ada Subject: Re: stupid question: how can I finish a program? Date: Fri, 16 Aug 2002 09:46:24 -0400 Organization: Posted on a server owned by Pace Micro Technology plc Message-ID: References: NNTP-Posting-Host: dhcp-200-180.miami.pace.co.uk X-Trace: nh.pace.co.uk 1029505589 45 136.170.200.180 (16 Aug 2002 13:46:29 GMT) X-Complaints-To: newsmaster@news.cam.pace.co.uk NNTP-Posting-Date: 16 Aug 2002 13:46:29 GMT X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Xref: archiver1.google.com comp.lang.ada:28153 Date: 2002-08-16T13:46:29+00:00 List-Id: Its hard to tell if my other posts are making it out there in a timely fashion. I made comments elsewhere in more detail about what I think needs to happen. But in case its not clear or getting out there, I'll take another shot at it. Since you can already raise an exception to terminate a given thread and you can do various other forms of task termination and you have a variety of ways of dealing with finalization, etc. I don't really see any need to re-address these things in any new language feature. The one thing you can't do is shoot any arbitrary Ada program square in the head from anywhere in the code and shut it down totally no matter what state it is in. In operating system parlance, we need a way of killing the process that is running the program. Do not pass go. Do not collect $200. :-) (The need to do this may not be an every day occurence, but it happens enough that its worth having a way of addressing it.) Shutting down the environment task comes close, except that it won't terminate *all* Ada programs. Tasks can get into states wherein they cannot be aborted and the language rules are such that you're still left needing to hit ctrl-C if you want the program to shut down. So it would be a good idea to incorporate a standard procedure that would need to do nothing more than call whatever OS function is available to cause the encasing process to be killed. (Are there any workstation-ish OS's that *don't* provide a mechanism for killing a process?) If there is no OS then the whole concept of "terminating the process" doesn't make much sense, since there is nothing to return control to. In this case you just insert an infinite loop - the program is effectively stopped. MDC -- Marin David Condic Senior Software Engineer Pace Micro Technology Americas www.pacemicro.com Enabling Digital. Our Vision is to be the biggest supplier worldwide of digital gateway technology. www.pacemicro.com wrote in message news:cHR69.6930$VV.242093357@newssvr21.news.prodigy.com... > > The problem is that "terminate" is ambiguous. Do you mean terminate > the current task? The task and all its children? All tasks in the > program? Do you want Finalization to occur or not occur? All, or just > some? If the code module that wants to terminate is in fact a reusable > component, should it really terminate the whole program and all its > tasks, or just the single component. What should happen when a > procedure designed as a whole program is used instead as a single > procedure in some larger program. Should the larger program terminate? > I'm inclined toward raising an unhandled exception. That gives the > overall program the option of an "others" handler to limit the "extent > of termination". Of course it also means "others" shouldn't be used > casually. One problem with a piece of code that aborts the environment > task is that it might be called from some other task, which would then > continue, with great confusion for all. > Probably most people asking the question just want to terminate the > single (environment) task in the simple program, with Finalization > occurring, and an unhandled exception does that nicely.