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.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,71f9c948bec0bcad X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1994-10-13 10:16:12 PST Path: bga.com!news.sprintlink.net!howland.reston.ans.net!europa.eng.gtefsd.com!MathWorks.Com!news.kei.com!world!blanket.mitre.org!linus.mitre.org!linus!mbunix!eachus From: eachus@spectre.mitre.org (Robert I. Eachus) Newsgroups: comp.lang.ada Subject: Re: "Common" data Date: 12 Oct 94 14:38:18 Organization: The Mitre Corp., Bedford, MA. Message-ID: References: <9410121737.AA28756@eurocontrol.de> NNTP-Posting-Host: spectre.mitre.org In-reply-to: Bob Wells #402's message of Wed, 12 Oct 1994 18:37:08 +0100 Date: 1994-10-12T14:38:18+00:00 List-Id: In article <9410121737.AA28756@eurocontrol.de> Bob Wells #402 writes: > Where abouts in the LRM does it say that I will only have one copy > of the variable T in the following code? This is naturally what you > would expect, that A.New_T_Value and B.New_T_Value would be working > on the same T, but is this defined in the LRM? > This is a trivialization of some comms code delivered to us, and we > wanted to see if the behaviour was defined by the LRM. You could start with RM 9.11 Shared Variables. If you can write a body for Update_T which complies with the assumptions of pragma Shared, go for it. Otherwise, in Ada 83, the body of Update_T will need to use a task to insure consistancy, or an implementation provided semaphore package. (Basically 9.11 says that tasks must not store values in registers across synchronization points, and pragma Shared can be used to create additional synchronization points for a specific variable.) If some of the updates are done by a mechanism outside the Ada program, many Ada compilers provide a pragma Volatile to say that each reference must read or write main memory. Hope this helps. -- Robert I. Eachus with Standard_Disclaimer; use Standard_Disclaimer; function Message (Text: in Clever_Ideas) return Better_Ideas is...