From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,4b06f8f15f01a568 X-Google-Attributes: gid103376,public From: dewarr@my-dejanews.com Subject: Re: Precalculation of parameters (was: Software landmines) Date: 1998/09/10 Message-ID: <6t93lv$fh5$1@nnrp1.dejanews.com>#1/1 X-Deja-AN: 389792106 References: <6t6hn9$t0m$1@nnrp1.dejanews.com> X-Http-Proxy: 1.0 x4.dejanews.com:80 (Squid/1.1.22) for client 205.232.38.14 Organization: Deja News - The Leader in Internet Discussion X-Article-Creation-Date: Thu Sep 10 17:53:04 1998 GMT Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/2.02 (OS/2; I) Date: 1998-09-10T00:00:00+00:00 List-Id: In article , stt@houdini.camb.inmet.com (Tucker Taft) wrote: > dennison@telepath.com wrote: > > : In article , > : 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