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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,5a05d88755a62a0e X-Google-Attributes: gid103376,public From: stt@houdini.camb.inmet.com (Tucker Taft) Subject: Re: Asynchronous Transfer of Control Date: 1996/10/17 Message-ID: #1/1 X-Deja-AN: 190037344 sender: news@inmet.camb.inmet.com (USENET news) x-nntp-posting-host: houdini.camb.inmet.com references: <32656457.1A76@csehp1.mdc.com> organization: Intermetrics, Inc. newsgroups: comp.lang.ada Date: 1996-10-17T00:00:00+00:00 List-Id: James Squire (m193884@csehp1.mdc.com) wrote: : The Ada 95 Rationale on page II-27 shows a short example of ATC that : looks something like this: : select : delay 1.0; : Text_IO.Put_Line ("Calculation could not be completed"); : then abort : Invert_Huge_Matrix (X); : end select; : I tried this, filling in nested for loops for the Invert_Huge_Matrix : statement, and then I added a Text_IO.Put_Line at the end of the : abortable part. : I then ran this in the debugger and rigged it so that the delay would : kick in first. BOTH my Put_Lines were executed, not to mention that the : for loops were STILL completed. : I reported it to the compiler vendor, and they pointed out to me from the : AARM (9.8) that I didn't have an abort completion point in my abortable : part. I looked at the list of things that qualify, and sure enough I : don't. Abort completion points are only important if the compiler does not support preemptive abort (D.6). Ask your vendor whether they support preemptive abort (it is required if they support the Real-Time annex). If they claim to support it, then you have found a bug. If not, then you may have to find a new compiler, or encourage your vendor to implement preemptive abort, or insert periodic abort completion points (which admittedly defeats the main purpose for ATC). In general, ATC is built on the same mechanism as abort. It was controversial during the Ada 9X design because of this, but ultimately that is also why it was accepted -- it doesn't really introduce problems that are significantly harder than handling abort (especially now that abort has to deal with arbitrary finalization). The down side of this connection is that if abort is not supported preemptively, then ATC is probably also not preemptive (sort of a "synchronous" Asynchronous Transfer of Control ;-). : Unless I am barking up the wrong tree or something, I really don't : understand this limitation. Is this yet another example of an invalid : code sample in the Rationale? The Rationale was presuming support for preemptive abort. The abort statement, and the asynchronous select, are admittedly not too useful if the vendor doesn't support preemptive abort. : James Squire mailto:m193884@csehp1.mdc.com : MDA Avionics Tools & Processes : McDonnell Douglas Aerospace http://www.mdc.com/ : Opinions expressed here are my own and NOT my company's : "He must never know what happened. If he should find out, he must : be killed. Do you understand, Delenn?" : -- Grey Council #1 (re: Sinclair), "And the Sky Full of Stars" -Tucker Taft stt@inmet.com http://www.inmet.com/~stt/ Intermetrics, Inc. Cambridge, MA USA