comp.lang.ada
 help / color / mirror / Atom feed
From: Bernd.Specht@gmx.com (Bernd Specht)
Subject: Re: tasking with GNAT 3.14p on windows
Date: Mon, 31 Mar 2003 21:09:36 +0200
Date: 2003-03-31T21:09:36+02:00	[thread overview]
Message-ID: <Xns934F8FC605DD7BerndSpechtgmxcom@62.153.159.134> (raw)
In-Reply-To: W4Oha.35749$ja4.2291095@bgtnsc05-news.ops.worldnet.att.net

"James S. Rogers" <jimmaureenrogers@worldnet.att.net> wrote in 
news:W4Oha.35749$ja4.2291095@bgtnsc05-news.ops.worldnet.att.net:

> "Jano" <nono@celes.unizar.es> wrote in message
> news:MPG.18f18ac32e4a300d9896c8@News.CIS.DFN.DE...
>> James S. Rogers dice...
>> > "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 null command will reliably take less than 3.0 seconds to complete.
>>
>> It's inside of a neverending loop.
> 
> And optimization will remove the loop, leaving a single null statement.

No.

1. If this would be true, then the program should terminate after a short 
time, but in fact it is still not terminated after a few hours. so it seem 
to "hang" inside the loop.


2. If this would be the  case it would be a serious compiler error. An 
endless loop must never be removed by compiler optimisation (it would be 
interessting to know the opinion of Robert Dewar).

I hope my code

loop
  if Get_Pressure > Upper_Limit
  then
    Open_Valve;
  elsif Get_Pressure < Lower_Limit
  then
    Close_Valve;
  end if;
end loop;


still executes, and was not only executed once due to compiler optimisation 
(I don't like to be blown up due to an compiler "feature").

> 
> Jim Rogers
> 
> 
> 




  parent reply	other threads:[~2003-03-31 19:09 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
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 [this message]
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