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=0.7 required=5.0 tests=BAYES_00,LOTS_OF_MONEY, MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,cbd507df3efa824b X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-01-30 22:10:06 PST Path: supernews.google.com!sn-xit-02!supernews.com!news.gv.tsc.tdk.com!falcon.america.net!sunqbc.risq.qc.ca!newsfeed.mathworks.com!news.maxwell.syr.edu!nntp2.deja.com!nnrp1.deja.com!not-for-mail From: Robert Dewar Newsgroups: comp.lang.ada Subject: Re: Help with Atomic_Components and whole array assignment Date: Wed, 31 Jan 2001 05:57:08 GMT Organization: Deja.com Message-ID: <9589fj$k66$1@nnrp1.deja.com> References: <94h55t$9a1$1@nnrp1.deja.com> <3A6C2CDD.67FD79DC@baesystems.com> <94hfaq$h3n$1@nnrp1.deja.com> <94hn5p$on4$1@nnrp1.deja.com> <3A76E3B9.BD806841@averstar.com> <9570ko$fg1$1@nnrp1.deja.com> <95Nd6.343422$U46.10481049@news1.sttls1.wa.home.com> NNTP-Posting-Host: 205.232.38.14 X-Article-Creation-Date: Wed Jan 31 05:57:08 2001 GMT X-Http-User-Agent: Mozilla/4.61 [en] (OS/2; U) X-Http-Proxy: 1.0 x54.deja.com:80 (Squid/1.1.22) for client 205.232.38.14 X-MyDeja-Info: XMYDJUIDrobert_dewar Xref: supernews.google.com comp.lang.ada:4736 Date: 2001-01-31T05:57:08+00:00 List-Id: In article <95Nd6.343422$U46.10481049@news1.sttls1.wa.home.com>, "DuckE" wrote: > I find the difference in interpretation of AARM C.6(20) > interesting. Remember that the AARM is not an official document, and not part of the official standard, so you can use it to try to understand the motivation behind the standard, but it never adds anything. > My interpretation of this statement is: if my program > contains two separate assigments to two distinct variables > for which pragma atomic applies, these assignments will be > performed as two distinct operations. Since the two > assignments appear as separate assignments in the code, if > the performed these assignments are combined as single > operation, an update is being performed that my program did > not specify. First, this statement is not part of the standard, so you cannot use it in interpreting what conformance means. But just for the moment, suppose this statement *were* part of the standard. Any *semantic* rule in the standard is always an "as-if" rule. This is fundamental to the nature of semantic specification. This means that if two possible translations have the same semantic effect, then they are equivalent. So I ask you the same question I asked Tuck, namely please provide the program that will (at least conceptually) show that the translation you claim is incorrect is semantically non-equivalent to separate stores. The trouble is that the semantic domain of the RM is not at the right level of abstraction to talk about machine instructions. THat's why it is often better and more precise to make requirements of this kind into implementation advice. In this particular case, the issue of whether to make this a requirement or IA did not arise, since it is not stated as a requirement in any case, and (at least speaking for myself as a reviewier) I had no idea that the design team intended this requirement. I thought of pragma Atomic basically as a renaming of the (confusingly named) pragma Shared in Ada 83, and it was certainly presented this way. > Since there is obviously some confusion over this issue > perhaps the AARM should be revised? That's irrelevant, since the AARM is not an official document. The only way to resolve confusion on this issue is to send a comment following the RM procedures, and have the ARG address the issue. I would think that the appropriate approach would be to introduce implementation advice, something to the effect Implementation Advice --------------------- A load or store of an atomic object should, where possible, be implemented by a single load or store instruction which accesses exactly the bits of the object and no others. The implementation should document those instances in which it is not possible to follow this advice. ----------- The reason this should be IA is that in IA, we are allowed to talk about things like load and store instructions, and we can intepret a statement like this in a helpful pragmatic manner, whereas if it appeared as a formal requirement, it would be meaningless (since it contains many undefined terms, and would be susecptible to the as-if semanitc interpretation which we specifically do NOT want in this case). I think it is quite reasonable to consider adding some IA of this kind. I suspect that most implementations can follow this easily enough -- what is missing is documentation of when it is not possible. Sent via Deja.com http://www.deja.com/