comp.lang.ada
 help / color / mirror / Atom feed
From: stt@houdini.camb.inmet.com (Tucker Taft)
Subject: Re: Asynchronous Transfer of Control
Date: 1996/10/17
Date: 1996-10-17T00:00:00+00:00	[thread overview]
Message-ID: <DzF1Fo.CJs.0.-s@inmet.camb.inmet.com> (raw)
In-Reply-To: 32656457.1A76@csehp1.mdc.com


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




  parent reply	other threads:[~1996-10-17  0:00 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-10-16  0:00 Asynchronous Transfer of Control James Squire
1996-10-16  0:00 ` Robert Dewar
1996-10-23  0:00   ` James Squire
1996-10-23  0:00     ` Robert Dewar
1996-10-17  0:00 ` Tucker Taft [this message]
1996-10-17  0:00   ` Robert A Duff
1996-10-17  0:00     ` Latest /= Greatest (was: Asynchronous Transfer of Control) Larry Kilgallen
1996-10-22  0:00       ` Asynchronous Transfer of Control Dale Stanbrough
1996-10-18  0:00     ` Ken Cowan
1996-10-18  0:00       ` Robert A Duff
1996-10-19  0:00       ` Robert Dewar
1996-10-21  0:00         ` Philip Brashear
1996-10-21  0:00           ` Validation vs. Certification (was: Asynchronous Transfer of Control) Larry Kilgallen
1996-10-21  0:00           ` Asynchronous Transfer of Control Robert Dewar
1996-10-21  0:00             ` Larry Kilgallen
1996-10-26  0:00               ` Robert Dewar
1996-10-22  0:00         ` Norman H. Cohen
1996-10-21  0:00       ` Pascal Ledru
1996-10-22  0:00     ` Jon S Anthony
1996-10-23  0:00     ` James Squire
1996-10-23  0:00       ` Robert Dewar
1996-10-29  0:00         ` m193884
1996-10-29  0:00           ` Robert Dewar
  -- strict thread matches above, loose matches on Subject: below --
2014-04-10 10:41 AdaMagica
2014-04-10 14:43 ` Dmitry A. Kazakov
2014-04-10 15:15 ` Adam Beneschan
2014-04-10 17:36   ` Adam Beneschan
2014-04-10 22:49   ` Randy Brukardt
2014-04-10 23:16     ` Adam Beneschan
2014-04-10 18:44 ` AdaMagica
2014-04-10 19:07 ` sbelmont700
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox