comp.lang.ada
 help / color / mirror / Atom feed
* Asynchronous Transfer of Control
@ 1996-10-16  0:00 James Squire
  1996-10-16  0:00 ` Robert Dewar
  1996-10-17  0:00 ` Tucker Taft
  0 siblings, 2 replies; 31+ messages in thread
From: James Squire @ 1996-10-16  0:00 UTC (permalink / raw)



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.

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?
-- 
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"




^ permalink raw reply	[flat|nested] 31+ messages in thread
* Asynchronous Transfer of Control
@ 2014-04-10 10:41 AdaMagica
  2014-04-10 14:43 ` Dmitry A. Kazakov
                   ` (3 more replies)
  0 siblings, 4 replies; 31+ messages in thread
From: AdaMagica @ 2014-04-10 10:41 UTC (permalink / raw)


This piece of code is very similar to RM 9.7.4(10-13).
It seems that GNT GPL 2013 on Windows does ot work correctly.

with Ada.Text_IO;
use  Ada.Text_IO;
with Ada.Calendar;
use  Ada.Calendar;

procedure Run_It is

  Line: String (1 .. 10);
  Last: Natural;
  Now : constant Time := Clock;

begin

  select
    delay 10.0;
    Put_Line ("aborted   " & Integer'Image (last) & Duration'Image (Clock - Now));
  then abort
    Put (" > ");
    Get_Line (Line, Last);
    Put_Line ("terminated" & Integer'Image (last) & Duration'Image (Clock - Now));
  end select;

end Run_It;

This is the result if I only press <return> after the delay has expired:
C:\...\Ada-Kode\run_it
 > 
terminated 0 26.688941821
aborted    0 26.689382659
[2014-04-10 12:24:42] process terminated successfully (elapsed time: 26.92s)

I.e. the abortable_part is not aborted.

Am I missing something? Or is this expected behaviour on Windows?


^ permalink raw reply	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2014-04-10 23:16 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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