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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,8ddc02527645a844 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-03-30 12:19:14 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!wn14feed!wn13feed!wn12feed!worldnet.att.net!bgtnsc05-news.ops.worldnet.att.net.POSTED!not-for-mail Reply-To: "James S. Rogers" From: "James S. Rogers" Newsgroups: comp.lang.ada References: Subject: Re: tasking with GNAT 3.14p on windows X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Message-ID: <6jIha.35142$ja4.2255611@bgtnsc05-news.ops.worldnet.att.net> Date: Sun, 30 Mar 2003 20:19:14 GMT NNTP-Posting-Host: 12.86.36.162 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc05-news.ops.worldnet.att.net 1049055554 12.86.36.162 (Sun, 30 Mar 2003 20:19:14 GMT) NNTP-Posting-Date: Sun, 30 Mar 2003 20:19:14 GMT Organization: AT&T Worldnet Xref: archiver1.google.com comp.lang.ada:35812 Date: 2003-03-30T20:19:14+00:00 List-Id: "Bernd Specht" wrote in message news:Xns934E8C5D49EFBerndSpechtgmxcom@62.153.159.134... > Hi, > > I tried an example from "Barnes, 18.8", but it didn't work as expected. Any > ideas? > > with Text_IO; use Text_IO; > > procedure TaskTest is > begin > select > delay 3.0; > put_line ("aborted"); > then abort > loop > null; -- modified > end loop; > end select; > end TaskTest; > > > The computation is not aborted (what I would expect). Do I misunderstand > something? Yes, you are misunderstanding something. This mechanism is sometimes called asynchronous transfer of control. The abortable part of your construct above is the null command. The null command will reliably take less than 3.0 seconds to complete. Whatever was in the original example in place of the null statement was the abortable part. The idea is that your program will start the abortable part and wait until the delay statement completes. If the abortable part completes first then the delay statement, and the statements following it before "then abort" are cancelled. If the delay statement finishes before the aboratble part, then the abortable part is aborted and the message following the delay statement is executed. All this said, the GNAT on windows operating systems does not properly support asynchronous transfer of control. Jim Rogers