comp.lang.ada
 help / color / mirror / Atom feed
From: eachus@spectre.mitre.org (Robert I. Eachus)
Subject: Re: "Common" data
Date: 12 Oct 94 14:38:18
Date: 1994-10-12T14:38:18+00:00	[thread overview]
Message-ID: <EACHUS.94Oct12143818@spectre.mitre.org> (raw)
In-Reply-To: Bob Wells #402's message of Wed, 12 Oct 1994 18:37:08 +0100

In article <9410121737.AA28756@eurocontrol.de> Bob Wells #402 <wel@EUROCONTROL.DE> 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...



  reply	other threads:[~1994-10-12 14:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1994-10-12 17:37 "Common" data Bob Wells #402
1994-10-12 14:38 ` Robert I. Eachus [this message]
1994-10-13  3:21   ` Tucker Taft
1994-10-13 11:47     ` Robert I. Eachus
1994-10-13 13:45 ` Norman H. Cohen
  -- strict thread matches above, loose matches on Subject: below --
1994-10-13 13:22 Keith Arthurs
replies disabled

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