comp.lang.ada
 help / color / mirror / Atom feed
From: europa.eng.gtefsd.com!fs7.ece.cmu.edu!news.sei.cmu.edu!ae@uunet.uu.net  ( Arthur Evans)
Subject: Re: Query about monitor (passive) task optimization
Date: 2 Aug 93 13:19:24 GMT	[thread overview]
Message-ID: <1993Aug2.091924.19310@sei.cmu.edu> (raw)

jls@ddciiny.UUCP (Jonathan Schilling) quotes Robert Dewar:
>>Mike [Feldman] assumes that automatic recognition of passive tasks is
>>a good thing.  He is apparently unaware that this is by no means
>>obvious, and indeed most of the Ada folks in realtime areas that I
>>have talked to do not AT ALL like the idea of such automatic
>>recognition, and much prefer explicit control over thread structure.

Schilling replies:
>I've heard of these objections before, but I don't fully understand them. 
>Assuming the optimization is transparent to the programmer, and does not 
>in any way change the semantics of the program, what "control" is being
>lost?  From within the program, using only standard Ada, one wouldn't
>even be able to detect whether the optimization had happened or not 
>(this might be doable with CIFO-type interfaces, depending on the
>runtime system implementation).  The only difference is that the program
>runs faster.

mfeldman@seas.gwu.edu (Michael Feldman) replies:
> Exactly. That's why I applauded DDC-I for doing it.

> The reason for the objection is that people do not trust their
> compilers, especially in the realtime business.
> [MORE, DELETED]

That's not the reason that was cited by the real-time folks in Ada 9X
design discussions.

Consider a real time application with tight time constraints.  The
programmer, who is familiar with the requirements of the vendor's
compiler, codes the task with care so that the compiler will be able to
perform clever optimizations.  The code meets its requirements.

Later, in maintenance, another programmer makes a seemingly trivial
modification to the source code.  An effect, unfortunately, is that the
conditions for performing the optimization are no longer met.  The code
is still semantically correct, but the application fails in ways
difficult to diagnose because a timing constraint is sometimes missed.

The advantage of the pragma approach is that it precludes this
possibility.  Use of the pragma says, in effect, "I want the compiler to
perform this optimization, and I promise to avoid certain features that
preclude its use."  If a change in maintenance causes the promise not to
be kept, the complier can provide a clear diagnostic.

Should Ada cater to the hard real-time folks as above, or to the general
community that Mike speaks for?  Well, yes, it should -- to both.  But
keep in mind that Ada's initial sponsor had in mind embedded
applications, and that such applications usually have hard real-time
requirements.

Now, having said all that, I can agree with Mike's comment.  Here it is
10 years after standardization of Ada-83.  It may not be surprising that
vendors first took the pragma approach; it's sad that after all this
time so few have implemented the optimizations.  The right approach, I
would say, is to implement the optimizations _and_ provide a pragma that
makes the promise that the program will meet the requirements for the
optimization.

Art Evans
----------------------------------------------
Arthur Evans, Jr, PhD           Ada Consultant
461 Fairview Road
Pittsburgh PA  15238-1933
412-963-0839
ae@sei.cmu.edu

             reply	other threads:[~1993-08-02 13:19 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1993-08-02 13:19  Arthur Evans [this message]
  -- strict thread matches above, loose matches on Subject: below --
1993-08-13  7:32 Query about monitor (passive) task optimization agate!howland.reston.ans.net!darwin.sura.net!sgiblab!munnari.oz.au!goanna
1993-08-11  2:34 agate!usenet.ins.cwru.edu!magnus.acs.ohio-state.edu!math.ohio-state.edu!u
1993-08-10 23:49 Michael Feldman
1993-08-10 23:14 Michael Feldman
1993-08-10 13:51 Robert Dewar
1993-08-10 13:44 Robert Dewar
1993-08-10  1:47 cis.ohio-state.edu!math.ohio-state.edu!darwin.sura.net!seas.gwu.edu!mfeld
1993-08-10  1:38 cis.ohio-state.edu!math.ohio-state.edu!darwin.sura.net!seas.gwu.edu!mfeld
1993-08-09 21:15 Robert I. Eachus
1993-08-09 14:48 Jonathan Schilling
1993-08-09 12:14 Robert Dewar
1993-08-09 11:02 Richard Kenner
1993-08-09  4:57 Robert Dewar
1993-08-09  4:47 Robert Dewar
1993-08-09  4:41 Robert Dewar
1993-08-03 20:10 Michael Feldman
1993-08-03 20:01 Michael Feldman
1993-08-03 15:26 Jonathan Schilling
1993-08-03 10:11 Bjorn Kallberg
1993-08-02 18:17 Michael Feldman
1993-08-02 18:13 Michael Feldman
1993-08-02 17:47 Michael Feldman
1993-08-02 14:35 Jonathan Schilling
1993-08-02  6:41 Bjorn Kallberg
1993-08-02  3:30 Michael Feldman
1993-08-02  1:57 Jonathan Schilling
1993-08-01  3:25 Michael Feldman
1993-07-31  3:27 Robert Dewar
1993-07-30 17:51 Michael Feldman
replies disabled

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