From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: GNAT 4.8 atomic access to 64-bit objects
Date: Fri, 15 Nov 2013 22:19:15 +0100
Date: 2013-11-15T22:19:15+01:00 [thread overview]
Message-ID: <h7hi7m1nbl7e.14h9bnbgzis5a$.dlg@40tude.net> (raw)
In-Reply-To: alpine.DEB.2.10.1311152007300.5296@debian
On Fri, 15 Nov 2013 20:08:54 +0100, Stefan.Lucks@uni-weimar.de wrote:
> On Thu, 14 Nov 2013, Dmitry A. Kazakov wrote:
>
>> Is there a way to change this without machine code insertions?
>
> I guess, putting your 64-bit object into a protected object is not an
> option?
It is supposed to be lock-free. Using protected object would be very last
resort [*].
I was considering:
procedure Load
( Ptr : in out T;
Ret : in out T;
Model : int := ATOMIC_RELAXED
);
pragma Import (Intrinsic, Load, "__atomic_load");
The problem with this is that GNAT's implementation of intrinsic import
seems incapable to deal with overloaded GCC built-ins. Unfortunately, all
__atomic_* built-ins are sort of templates.
--------------------------
* I wonder why RM does not mandate pragma Atomic always legal. After all,
the compiler could always implement it using a hidden protected object.
Except when access occurs on the context of a protected action. Which is
statically known (or else program is erroneous). Within a protected action
it already atomic.
--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
next prev parent reply other threads:[~2013-11-15 21:19 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-14 15:57 GNAT 4.8 atomic access to 64-bit objects Dmitry A. Kazakov
2013-11-14 20:34 ` Ludovic Brenta
2013-11-15 8:44 ` Dmitry A. Kazakov
2013-11-15 19:25 ` Georg Bauhaus
2013-11-15 21:33 ` Dmitry A. Kazakov
2013-11-16 10:08 ` Georg Bauhaus
2013-11-16 12:02 ` Dmitry A. Kazakov
2013-11-15 19:08 ` Stefan.Lucks
2013-11-15 21:19 ` Dmitry A. Kazakov [this message]
2013-11-22 0:30 ` Randy Brukardt
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox