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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,e0e1d3b3f7c994b8 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!eweka.nl!lightspeed.eweka.nl!feeder1.cambrium.nl!feed.tweaknews.nl!newsfeed-0.progon.net!progon.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "Alex R. Mosteo" Newsgroups: comp.lang.ada Subject: Re: Robert Dewar's great article about the Strengths of Ada over other langauges in multiprocessing! Date: Fri, 14 Mar 2008 11:16:09 +0100 Message-ID: <63v1jgF283nutU1@mid.individual.net> References: <13t4b2kkjem20f3@corp.supernews.com> <89af8399-94fb-42b3-909d-edf3c98d32e5@n75g2000hsh.googlegroups.com> <2c2989ba-a109-40d6-b0a3-f91d94a2d291@a1g2000hsb.googlegroups.com> <47d906b4$0$1804$4d3efbfe@news.sover.net> <63sn1tF29a5oiU1@mid.individual.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: individual.net QvyxfGeOIlJTY36AXrdSEg3ZRmHwhfzLZoltoTbrOInotr4x4= Cancel-Lock: sha1:+vgBt29HvEtujWTh02ymYR8wnkk= User-Agent: KNode/0.10.5 Xref: g2news1.google.com comp.lang.ada:20371 Date: 2008-03-14T11:16:09+01:00 List-Id: Randy Brukardt wrote: > "Alex R. Mosteo" wrote in message > news:63sn1tF29a5oiU1@mid.individual.net... > ... >> Although in Ada I don't see much (or any?) use for volatile, non-atomic > shared >> variables outside of protected objects. >> >> Some flaw in my understanding? > > Yes, sort of. You're not considering non-tasking uses. The canonical example > for Volatile is reading/writing a memory-mapped hardware device. In that > case, optimizing out the reads/writes can be fatal. It doesn't directly have > anything to do with tasking. (I suppose one could consider the hardware > device as a sort of task, but it would be done with unusual properties.) Ah, of course. I was so bent on looking for strange uses that I missed the obvious one. > Another purpose is for debugging. You can monitor the memory location of a > Volatile object to see what is going on, without the pragma the compiler can > optimize the entire object away leaving nothing to monitor. (Of course, the > pragma also changes the code, which might change the bug you are trying to > find.) Hehe. Happily I only need the debugger once in a trimester or so :) > (...) Thanks!