comp.lang.ada
 help / color / mirror / Atom feed
From: "James S. Rogers" <jimmaureenrogers@worldnet.att.net>
Subject: Re: tasking with GNAT 3.14p on windows
Date: Sun, 30 Mar 2003 20:19:14 GMT
Date: 2003-03-30T20:19:14+00:00	[thread overview]
Message-ID: <6jIha.35142$ja4.2255611@bgtnsc05-news.ops.worldnet.att.net> (raw)
In-Reply-To: Xns934E8C5D49EFBerndSpechtgmxcom@62.153.159.134

"Bernd Specht" <Bernd.Specht@gmx.com> 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





  reply	other threads:[~2003-03-30 20:19 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-30 18:49 tasking with GNAT 3.14p on windows Bernd Specht
2003-03-30 20:19 ` James S. Rogers [this message]
2003-03-30 22:14   ` Jano
2003-03-31  2:53     ` James S. Rogers
2003-03-31  6:32       ` James S. Rogers
2003-03-31  6:56       ` Sergey Koshcheyev
2003-03-31  9:00         ` 
2003-03-31 19:09       ` Bernd Specht
2003-03-31 18:14     ` Chad R. Meiners
2003-03-31 21:08       ` Jano
2003-03-31  7:57 ` 
2003-03-31  9:30   ` Ole-Hjalmar Kristensen
2003-03-31 17:58     ` Jano
2003-03-31 18:30       ` Chad R. Meiners
2003-03-31 22:16         ` Jano
2003-03-31 23:09           ` Chad R. Meiners
2003-03-31 23:44           ` Chad R. Meiners
2003-04-01 12:17             ` Jano
2003-04-01  2:40         ` Robert A Duff
2003-04-01  4:17           ` Chad R. Meiners
2003-04-01  6:25             ` Jano
2003-04-01 15:33               ` Pascal Obry
2003-04-01  8:42           ` Dmitry A. Kazakov
2003-04-02 13:35             ` Alfred Hilscher
replies disabled

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