From: stevenselectronicmail@gmail.com
Subject: Re: Lock-Free stack in Ada SPARK
Date: Sat, 11 Feb 2017 15:02:21 -0800 (PST)
Date: 2017-02-11T15:02:21-08:00 [thread overview]
Message-ID: <5b707d82-ecab-4d7f-bf04-099412e16913@googlegroups.com> (raw)
In-Reply-To: <o7o3si$1dg6$1@gioia.aioe.org>
On Saturday, February 11, 2017 at 2:40:23 PM UTC-8, Dmitry A. Kazakov wrote:
> On 2017-02-11 20:36, Jeffrey R. Carter wrote:
> > Perhaps someone will enlighten me.
> >
> > All of the lock-free structures that I've looked at involved busy
> > waiting on a memory location via an atomic test-and-set/compare-and-swap
> > operation.
>
> Yes.
>
> > To my mind, that's an implementation of a lock, and I don't understand
> > why these are considered lock free.
>
> You are right. An implementation based on protected objects is clearly a
> blocking.
>
> Yet in its idea protected objects meant to be somewhere in-between.
> Logically, at the application level, a protected action is considered
> "instant" and thus logically it is "lock-free", provided the programmer
> does not abuse it running cycles on the context of a protected action.
>
> But it is not instant at the machine level. If the protected object
> overhead were comparable to a few normal processor instructions and
> would never cause any task losing the CPU, then it might be considered
> "lock-free" both logically and physically. But it certainly not so on
> most architectures.
>
> --
> Regards,
> Dmitry A. Kazakov
> http://www.dmitry-kazakov.de
Dmitry you seem confused. I don't use normal protected objects. I use the special Lock_Free pragma which allows to generate lock-free code for certain very restricted protected objects.
next prev parent reply other threads:[~2017-02-11 23:02 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-11 3:07 Lock-Free stack in Ada SPARK stevenselectronicmail
2017-02-11 9:57 ` Hadrien Grasland
2017-02-11 10:07 ` Hadrien Grasland
2017-02-11 10:08 ` Hadrien Grasland
2017-02-11 10:14 ` Hadrien Grasland
2017-02-11 17:34 ` stevenselectronicmail
2017-02-11 19:36 ` Jeffrey R. Carter
2017-02-11 20:42 ` stevenselectronicmail
2017-02-11 22:40 ` Dmitry A. Kazakov
2017-02-11 23:02 ` stevenselectronicmail [this message]
2017-02-12 8:30 ` Dmitry A. Kazakov
2017-02-12 12:26 ` Hadrien Grasland
2017-02-12 12:49 ` Dmitry A. Kazakov
2017-02-12 13:19 ` Hadrien Grasland
2017-02-12 14:57 ` Dmitry A. Kazakov
2017-02-12 13:04 ` Hadrien Grasland
2017-02-12 22:25 ` Robert Eachus
2017-02-13 8:22 ` Dmitry A. Kazakov
2017-02-13 20:04 ` stevenselectronicmail
2017-02-21 1:51 ` Robert Eachus
2017-02-21 8:44 ` 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