comp.lang.ada
 help / color / mirror / Atom feed
* Multiple Delay alternatives : what it is useful to ?
@ 2010-02-04  3:47 Hibou57 (Yannick Duchêne)
  2010-02-04  4:47 ` Jeffrey R. Carter
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Hibou57 (Yannick Duchêne) @ 2010-02-04  3:47 UTC (permalink / raw)


Hi all out there,

[ARM 9.7.1(10)] and [ARM 9.7.1(13)],
http://www.adaic.org/standards/05rm/html/RM-9-7-1.html
explicitly allows multiple Delay alternatives in a Select statement
(finally GNAT was right), as I've checked.

Know I now it is legal, I just wonder why ?

If some delays stand for a time which is sooner than others delays
alternatives, the others will never be triggered. Or they may be ?
Does it have something to deal with variable delay ? If it is, the
runtime will then simply select the sooner ignoring all others ?

And what if two delays stands for the same time ? I do not see
anything which clarify this situation in the RM (may be I've missed
it).

Are they some real life examples of useful multiple delays
alternatives ?

By the way, a sentence is unclear to me : at 9.7.1(10), there is a “
If a selective_accept contains more than one delay_alternative, then
all shall be delay_relative_statements, or all shall be
delay_until_statements for the same time type. ” .... same time type ?
I could not construe these last three words.



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

* Re: Multiple Delay alternatives : what it is useful to ?
  2010-02-04  3:47 Multiple Delay alternatives : what it is useful to ? Hibou57 (Yannick Duchêne)
@ 2010-02-04  4:47 ` Jeffrey R. Carter
  2010-02-04  9:26 ` Jean-Pierre Rosen
  2010-02-05 21:55 ` Randy Brukardt
  2 siblings, 0 replies; 5+ messages in thread
From: Jeffrey R. Carter @ 2010-02-04  4:47 UTC (permalink / raw)


Hibou57 (Yannick Duch�ne) wrote:
> 
> By the way, a sentence is unclear to me : at 9.7.1(10), there is a �
> If a selective_accept contains more than one delay_alternative, then
> all shall be delay_relative_statements, or all shall be
> delay_until_statements for the same time type. � .... same time type ?
> I could not construe these last three words.

Ada.Calendar.Time and Ada.Real_Time.Time are 2 different time types, and an 
implementation may provide others.

-- 
Jeff Carter
"Now go away or I shall taunt you a second time."
Monty Python & the Holy Grail
07



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

* Re: Multiple Delay alternatives : what it is useful to ?
  2010-02-04  3:47 Multiple Delay alternatives : what it is useful to ? Hibou57 (Yannick Duchêne)
  2010-02-04  4:47 ` Jeffrey R. Carter
@ 2010-02-04  9:26 ` Jean-Pierre Rosen
  2010-02-04 18:48   ` Hibou57 (Yannick Duchêne)
  2010-02-05 21:55 ` Randy Brukardt
  2 siblings, 1 reply; 5+ messages in thread
From: Jean-Pierre Rosen @ 2010-02-04  9:26 UTC (permalink / raw)


Hibou57 (Yannick Duch�ne) a �crit :
> Hi all out there,
> 
> [ARM 9.7.1(10)] and [ARM 9.7.1(13)],
> http://www.adaic.org/standards/05rm/html/RM-9-7-1.html
> explicitly allows multiple Delay alternatives in a Select statement
> (finally GNAT was right), as I've checked.
> 
> Know I now it is legal, I just wonder why ?
> 
> If some delays stand for a time which is sooner than others delays
> alternatives, the others will never be triggered. Or they may be ?
> Does it have something to deal with variable delay ? If it is, the
> runtime will then simply select the sooner ignoring all others ?
The shortest one will be triggered. Why allow several? Because the
delays need not be static, so which is one is shorter may not be
determined at compile time, and several time-out may correspond to
different conditions, with different attached processing.

select
  ...
or delay until dawn; ...
or delay until closing_time; ...
end select;

> 
> And what if two delays stands for the same time ? I do not see
> anything which clarify this situation in the RM (may be I've missed
> it).
one of them is selected arbitrarily, unless a queuing policy says
otherwise (9.7.1(18))

> Are they some real life examples of useful multiple delays
> alternatives ?
See above ;-)

> By the way, a sentence is unclear to me : at 9.7.1(10), there is a �
> If a selective_accept contains more than one delay_alternative, then
> all shall be delay_relative_statements, or all shall be
> delay_until_statements for the same time type. � .... same time type ?
> I could not construe these last three words.
The expression of a delay until statement expects a value of a time type
(9.6(6)). Time types are implementation defined. The idea is that if you
have a board with several hardware clocks, the implementation would
define a time type for each of them; the type of the expression would
determine which clock to use for the delay.

-- 
---------------------------------------------------------
           J-P. Rosen (rosen@adalog.fr)
Visit Adalog's web site at http://www.adalog.fr



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

* Re: Multiple Delay alternatives : what it is useful to ?
  2010-02-04  9:26 ` Jean-Pierre Rosen
@ 2010-02-04 18:48   ` Hibou57 (Yannick Duchêne)
  0 siblings, 0 replies; 5+ messages in thread
From: Hibou57 (Yannick Duchêne) @ 2010-02-04 18:48 UTC (permalink / raw)


On 4 fév, 05:47, "Jeffrey R. Carter" <spam.jrcarter....@spam.acm.org>
wrote:
> Ada.Calendar.Time and Ada.Real_Time.Time are 2 different time types, and an
> implementation may provide others.
>
> --
> Jeff Carter
Will have a look (I will have to come to it anyway if I want to go
further)

On 4 fév, 10:26, Jean-Pierre Rosen <ro...@adalog.fr> wrote:
> The shortest one will be triggered. Why allow several? Because the
> delays need not be static, so which is one is shorter may not be
> determined at compile time, and several time-out may correspond to
> different conditions, with different attached processing.
Ok, so that's a matter of variables (while the word “ static ” better
express things, that's true).

> > Are they some real life examples of useful multiple delays
> > alternatives ?
>
> See above ;-)
It was a good one indeed :) Thanks



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

* Re: Multiple Delay alternatives : what it is useful to ?
  2010-02-04  3:47 Multiple Delay alternatives : what it is useful to ? Hibou57 (Yannick Duchêne)
  2010-02-04  4:47 ` Jeffrey R. Carter
  2010-02-04  9:26 ` Jean-Pierre Rosen
@ 2010-02-05 21:55 ` Randy Brukardt
  2 siblings, 0 replies; 5+ messages in thread
From: Randy Brukardt @ 2010-02-05 21:55 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 809 bytes --]

"Hibou57 (Yannick Duch�ne)" <yannick_duchene@yahoo.fr> wrote in message 
news:77f81f9d-23a2-4d59-a547-c577e009c50c@19g2000yql.googlegroups.com...
>Hi all out there,
>
> By the way, a sentence is unclear to me : at 9.7.1(10), there is a �
> If a selective_accept contains more than one delay_alternative, then
> all shall be delay_relative_statements, or all shall be
> delay_until_statements for the same time type. � .... same time type ?
> I could not construe these last three words.

The index of the ARM is your friend. If you looked up "time type" in the 
index, you would see a reference to 9.6(6). If you are using the HTML 
version of the ARM, clicking on that in the index will take you directly to 
that paragraph where the term is defined.

                                       Randy.





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

end of thread, other threads:[~2010-02-05 21:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-04  3:47 Multiple Delay alternatives : what it is useful to ? Hibou57 (Yannick Duchêne)
2010-02-04  4:47 ` Jeffrey R. Carter
2010-02-04  9:26 ` Jean-Pierre Rosen
2010-02-04 18:48   ` Hibou57 (Yannick Duchêne)
2010-02-05 21:55 ` Randy Brukardt

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