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,CP1252 X-Google-Thread: 103376,8893269a4640c798 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-07-22 21:02:54 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!arclight.uoregon.edu!wn13feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi.com!sccrnsc04.POSTED!not-for-mail Message-ID: <3F1E08E9.2070708@attbi.com> From: "Robert I. Eachus" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.2) Gecko/20021120 Netscape/7.01 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: terminate applications References: <3F17DF3C.4080204@noplace.com> <3F196773.2060809@noplace.com> <3F19F86C.9050808@attbi.com> <3F1A772F.9060708@noplace.com> <3F1AD6FB.8080806@attbi.com> <3F1BD666.6040506@noplace.com> <3F1C4DA6.3070405@attbi.com> <3F1D29E8.60107@noplace.com> <3F1D2FDC.1070402@noplace.com> <3F1DC75A.5050300@noplace.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit NNTP-Posting-Host: 66.31.71.243 X-Complaints-To: abuse@comcast.net X-Trace: sccrnsc04 1058932970 66.31.71.243 (Wed, 23 Jul 2003 04:02:50 GMT) NNTP-Posting-Date: Wed, 23 Jul 2003 04:02:50 GMT Organization: Comcast Online Date: Wed, 23 Jul 2003 04:02:50 GMT Xref: archiver1.google.com comp.lang.ada:40681 Date: 2003-07-23T04:02:50+00:00 List-Id: Marin David Condic wrote: > If Ada wants to be competitive against C, C++, Java or whatever else is > out there, it has to be focused on customer needs. It can't be dependent > on sending the customer to the competitor for features it can't or won't > support, or the customer just starts to wonder why he is bothering with > Ada when he has to have the other product anyway in order to get the job > done. Ada needs to provide "One-Stop Shopping" so a developer doesn't > need to look elsewhere for an answer. As I have said, I think that you may have a need that should be addressed. But remember what you are asking for here. To get to the point where you need this feature in Ada, you have to use not normal (Ada 83) tasking but protected objects or asynchronous transfer of control. Furthermore you have to place a blocking action--or more normally an endless loop--inside an abort deferred region. As I said, I certainly agree that, especially for debugging situations, such a feature would be nice to have. But the more I think about it, the more I think that the right solution may be to add a special procedure that breaks the abort deferral. Let's see, with Ada.Task_Identification; use Ada.Task_Identification; procedure Exit_Abort_Deferred_Region is begin if Is_Terminated(Current_Task) then raise Program_Error; end if; end Exit_Abort_Deferred_Region; Not very special after all, but you do need Ada.Task_Identification from Annex C. And if you do insist on putting loops inside protected object, probably a useful tool to have around. (For example, if you do a search through a linked list. Or use an AVL or other type of tree and do lookups.) Putting that in busy waits inside protected objects and in other loops where you might have a problem solves part of the problem. The other problem, of aborting a task that is waiting IN the OS has to be an implementation defined thing. But it shouldn't be too hard to talk your vendor in to checking whether a task that is being aborted is waiting in an OS call and doing whatever OS specific thing is required to get out there. Especially where Ada tasks correspond to OS threads, that shouldn't be too hard. You don't care why that (abort protected) thread is not in a ready state in the OS, you want to kill any such threads. (Since making a blocking call from an abort protected region is a bounded error, I don't think any langauge changes are required for this.) -- Robert I. Eachus �In an ally, considerations of house, clan, planet, race are insignificant beside two prime questions, which are: 1. Can he shoot? 2. Will he aim at your enemy?� -- from the Laiden novels by Sharon Lee and Steve Miller.