comp.lang.ada
 help / color / mirror / Atom feed
From: Mark Johnson <mark_h_johnson@raytheon.com>
Subject: Re: Pragma Volatile
Date: Tue, 25 Sep 2001 18:03:46 -0500
Date: 2001-09-25T18:03:46-05:00	[thread overview]
Message-ID: <3BB10D52.4D455DBA@raytheon.com> (raw)
In-Reply-To: 3BB08F9C.BFB01047@raytheon.com

"Jon R. Harshaw" wrote:

> OK. - Since I can't find a reference for this in my limited
> documentation, what does "Pragma Volatile" do?  I'm guessing that it is
> just available while the process that invokes it is up and running, but
> that's just a WAG...

Hmm. Which "limited documentation" are you looking at.

A quick search of the web for pragma, volatile, and Ada find several good
references....
 - Ada 95 style guide,
http://www.cs.aston.ac.uk/~barnesa/ada_style/cover.html (look in section 6
on concurrency)
 - Ada 95 rationale,
http://lglwww.epfl.ch/docs/ada/rat95html-1.04/rat95-p3-c.html#5
and so on.

As others have noted, the Ada Reference Manual defines the term. Looking
in the bookcase on my right, I note that The Annotated ARM in section C.6
(para 20.a through 20.i) has a nice example describing how extra load /
extra store operations are not allowed & that loads and stores may not be
reordered.

A caution, after reading a number of articles on caches & memory
visibility, I am not so sure the compiler vendors are putting enough care
into enforcing the last restriction. In general, caches can reorder or
combine writes which could violate that restriction. If you use volatile
in conjunction w/ protected units and objects, you are probably OK. This
is really a system dependent problem & I would need a lot more information
about what you are trying to do [and why] to determine if you would have
this problem.
--Mark






  parent reply	other threads:[~2001-09-25 23:03 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-09-25 14:07 Pragma Volatile Jon R. Harshaw
2001-09-25 14:23 ` David C. Hoos
2001-09-25 14:38 ` Marin David Condic
2001-09-25 23:03 ` Mark Johnson [this message]
2001-09-29 17:38   ` Tucker Taft
2001-09-29 18:22     ` minyard
2001-09-29 22:28       ` Jeffrey Carter
2001-09-30 13:10         ` Robert Dewar
2001-09-30 21:19           ` Jeffrey Carter
2001-10-01  2:58             ` minyard
2001-10-02  9:38           ` AG
2001-10-02 10:59             ` Jeff Creem
2001-09-30  2:03       ` DuckE
2001-09-30 13:01       ` Robert Dewar
2001-09-30 20:12         ` minyard
replies disabled

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