comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Portable memory barrier?
Date: Wed, 10 May 2017 20:14:53 -0500
Date: 2017-05-10T20:14:53-05:00	[thread overview]
Message-ID: <of0due$35j$1@franka.jacob-sparre.dk> (raw)
In-Reply-To: bcb9bcd3-34f2-4075-905d-bd1957657dc6@googlegroups.com

"Jere" <jhb.chat@gmail.com> wrote in message 
news:bcb9bcd3-34f2-4075-905d-bd1957657dc6@googlegroups.com...
> On Tuesday, May 9, 2017 at 3:49:29 PM UTC-4, Randy Brukardt wrote:
....
> I got a test going today and tried it on two different GNAT 
> implementations on
> two different processors.  I found that the GPL version of GNAT (gcc 
> 4.9.3)
> works as you state.  Atomic prevents changes in instruction sequence. 
> However,
> my older version (FSF GCC 4.1.2) does not.  Atomic had no affect on 
> sequence
> (from a CPU perspective at least).  I am guessing that Atomic's definition 
> was
> weaker back then.

It was never "weaker", but the implications on compilers were not as well 
understood (especially the ones about fences). AI05-0117-1 was the original 
discussion on this topic, it was mostly worked on in 2010. (It originated 
earlier, but all work was in 2010 and 2011.) AI05-0275-1 clarified this 
further in late 2011 and early 2012.

So it's likely that compilers implemented prior to 2010 don't implement any 
fences for atomic objects, mostly likely because the need for them wasn't 
understood. (I personally had no idea...) More recent compilers are much 
more likely to do it right.

Also note that the 2010 AI was classified as an Amendment, so it only 
applies to Ada 2012. I'm not sure why that was (the definition in Ada 2012 
is *weaker* than the one in earlier Ada versions), but it does mean that any 
Ada 95 or Ada 2005 implementations may not deal with this properly.

                                      Randy.





  reply	other threads:[~2017-05-11  1:14 UTC|newest]

Thread overview: 65+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-06  2:23 Portable memory barrier? Jere
2017-05-06  8:47 ` Jeffrey R. Carter
2017-05-06 14:17   ` Jere
2017-05-06 19:08     ` Dennis Lee Bieber
2017-05-06 19:26     ` Jeffrey R. Carter
2017-05-06 19:41     ` Jeffrey R. Carter
2017-05-06 20:42       ` Niklas Holsti
2017-05-09 19:49     ` Randy Brukardt
2017-05-09 22:07       ` Jere
2017-05-11  1:14         ` Randy Brukardt [this message]
2017-05-10 18:28       ` Shark8
2017-05-11  1:17         ` Randy Brukardt
2017-05-11 16:23           ` Jeffrey R. Carter
2017-05-07 20:18 ` Robert Eachus
2017-05-08  7:45   ` Dmitry A. Kazakov
2017-05-08 15:56     ` Robert Eachus
2017-05-08 16:22       ` Dmitry A. Kazakov
2017-05-08 18:39         ` Robert Eachus
2017-05-08 19:18         ` Robert Eachus
2017-05-08 21:09           ` Dmitry A. Kazakov
2017-05-08 23:24             ` Robert Eachus
2017-05-09  0:30               ` Jere
2017-05-09  4:02                 ` Robert Eachus
2017-05-09  4:32                 ` Robert Eachus
2017-05-09  4:44                   ` Robert Eachus
2017-05-09 22:26                   ` Jere
2017-05-09 20:01                 ` Randy Brukardt
2017-05-09 19:57               ` Randy Brukardt
2017-05-10  0:51                 ` Jere
2017-05-10  5:25                   ` J-P. Rosen
2017-05-10 22:56                     ` Jere
2017-05-11  7:36                       ` Dmitry A. Kazakov
2017-05-13 20:25                         ` Jere
2017-05-10  7:13                   ` Dmitry A. Kazakov
2017-05-10 16:45                     ` Robert Eachus
2017-05-10 17:28                       ` Simon Wright
2017-05-10 23:21                     ` Jere
2017-05-11  0:47                       ` Randy Brukardt
2017-05-13 20:11                         ` Jere
2017-05-15 22:33                           ` Randy Brukardt
2017-05-10 23:30                     ` Jere
2017-05-11  0:38                     ` Randy Brukardt
2017-05-10 16:38                   ` Jeffrey R. Carter
2017-05-10 23:40                     ` Jere
2017-05-10 16:19                 ` Robert Eachus
2017-05-11  1:02                   ` Randy Brukardt
2017-05-11  1:51                     ` Robert Eachus
2017-05-15 22:45                       ` Randy Brukardt
2017-05-08 20:29         ` Niklas Holsti
2017-05-08 21:09           ` Dmitry A. Kazakov
2017-05-09  4:34             ` Niklas Holsti
2017-05-09  6:16               ` Niklas Holsti
2017-05-09  8:34                 ` Dmitry A. Kazakov
2017-05-09 20:18                 ` Randy Brukardt
2017-05-09 20:10           ` Randy Brukardt
2017-05-09  0:05         ` Jere
2017-05-09  8:26           ` Dmitry A. Kazakov
2017-05-09 19:53         ` Randy Brukardt
2017-05-09 20:27           ` Dmitry A. Kazakov
2017-05-11  0:35             ` Randy Brukardt
2017-05-11  8:24               ` Dmitry A. Kazakov
2017-05-15 22:53                 ` Randy Brukardt
2017-05-18 17:44                   ` Dmitry A. Kazakov
2017-05-18 21:01                     ` Randy Brukardt
2017-05-19  7:54                       ` Dmitry A. Kazakov
replies disabled

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