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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,148d39ae0d22411d X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-09-25 16:15:07 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!feed.textport.net!out.nntp.be!propagator-SanJose!news-in-sanjose!in.nntp.be!easynews!crtntx1-snh1.gtei.net!cambridge1-snf1.gtei.net!news.gtei.net!bos-service1.ext.raytheon.com!dfw-service2.ext.raytheon.com.POSTED!not-for-mail Message-ID: <3BB10D52.4D455DBA@raytheon.com> From: Mark Johnson Reply-To: mark_h_johnson@raytheon.com X-Mailer: Mozilla 4.78 [en] (X11; U; Linux 2.4.6-3.1smp i686) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Pragma Volatile References: <3BB08F9C.BFB01047@raytheon.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Tue, 25 Sep 2001 18:03:46 -0500 NNTP-Posting-Host: 192.27.48.41 X-Complaints-To: news@ext.ray.com X-Trace: dfw-service2.ext.raytheon.com 1001459029 192.27.48.41 (Tue, 25 Sep 2001 18:03:49 CDT) NNTP-Posting-Date: Tue, 25 Sep 2001 18:03:49 CDT Organization: Raytheon Company Xref: archiver1.google.com comp.lang.ada:13374 Date: 2001-09-25T18:03:46-05:00 List-Id: "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