comp.lang.ada
 help / color / mirror / Atom feed
From: dewarr@my-dejanews.com
Subject: Re: Precalculation of parameters (was: Software landmines)
Date: 1998/09/10
Date: 1998-09-10T00:00:00+00:00	[thread overview]
Message-ID: <6t93lv$fh5$1@nnrp1.dejanews.com> (raw)
In-Reply-To: Ez28B6.DMI.0.-s@inmet.camb.inmet.com

In article <Ez28B6.DMI.0.-s@inmet.camb.inmet.com>,
  stt@houdini.camb.inmet.com (Tucker Taft) wrote:
> dennison@telepath.com wrote:
>
> : In article <Ez0tp1.59L.0.-s@inmet.camb.inmet.com>,
> :   stt@houdini.camb.inmet.com (Tucker Taft) wrote:
> : > dennison@telepath.com wrote:
> : >
> : > : Is that actually the rule?
> : >
> : > RM95 6.4(10) permits evaluation of parameters in an "arbitrary"
> : > order.   RM95 1.1.4(18) defines "arbitrary" order, indicating
> : > that it must be an order that is equivalent to some sequential
> : > ordering.                                      ^^^^^^^^^^^^^^^
> :   ^^^^^^^^
>
> : Ahhh. That was the part I was missing. So language was specifically added
to
> : the RM to prevent compilers from blindly parallelizing this. Out of
> : curiosity, what was the reason this was done? I can't find anything about
it
> : in the Rationale.
>
> All code within a single task is defined to be "sequential." This
> is critical to being able to prove things about safe access to global
> variables.  If the RM allowed parallel evaluation of parameter expressions,
> all of the discussion in RM95 9.10 about sharing variables between tasks and
> about "independent addressability" would have to apply to sharing variables
> and manipulating neighboring packed-array components between different
> parameter evaluations, which would dramatically increase the likelihood
> of erroneous execution per 9.10(11).
>
> See RM95 9.10 for a discussion of these issues.  The critical paragraph
> is 9.10(13), where any two actions that occur as part of the execution
> of a single task are defined to be "sequential."  In some ways, that
> *is* the definition of a "task."
>
> : --
> : T.E.D.
>
> --
> -Tucker Taft   stt@inmet.com   http://www.inmet.com/~stt/
> Intermetrics, Inc.  Burlington, MA  USA
>


Note that in one respect Ada went MUCH too far, and that is
the decision that for a binary operator you must evaluate
either left-then-right, or right-then-left.

While I don't think anyone would argue for the collateral
(parallel) evaluation semantics of Algol-68 in a language
with side effects, it is still annoying that in

  (f + g) + (h + i)

where f,g,h,i are function calls, that

f/g/h/i
g/f/h/i
f/g/i/h
g/f/i/h
h/i/f/g
h/i/g/f
i/h/f/g
i/h/g/f

are all permitted orders, but no other orders (e.g.

f/h/g/i

are permissible. This seems to me to be silly over
specification. Note that it is very hard to construct
an example where this matters (and even the ACVC tests
do not test for this).

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum




  reply	other threads:[~1998-09-10  0:00 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-08-22  0:00 Software landmines (was: Why C++ is successful) dewar
1998-08-23  0:00 ` Dale Stanbrough
1998-08-23  0:00   ` dewar
1998-08-23  0:00   ` Andi Kleen
1998-08-24  0:00 ` Richard D Riehle
1998-08-25  0:00   ` Andi Kleen
1998-08-25  0:00     ` Brian Rogoff
1998-08-25  0:00   ` dennison
1998-08-28  0:00   ` Matthew Heaney
1998-08-28  0:00     ` Richard D Riehle
1998-08-29  0:00       ` Matthew Heaney
1998-09-06  0:00         ` John G. Volan
1998-09-07  0:00           ` Mats Weber
1998-09-07  0:00             ` dewarr
1998-09-08  0:00               ` Tucker Taft
1998-09-08  0:00                 ` Precalculation of parameters (was: Software landmines) dennison
1998-09-09  0:00                   ` Tucker Taft
1998-09-09  0:00                     ` dennison
1998-09-10  0:00                       ` Tucker Taft
1998-09-10  0:00                         ` dewarr [this message]
1998-09-16  0:00               ` Software landmines (was: Why C++ is successful) Matthew Heaney
1998-08-29  0:00       ` Matthew Heaney
     [not found]   ` <35eca5d9.4354839@news.geccs.gecm.com>
1998-09-01  0:00     ` Richard D Riehle
replies disabled

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