comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Lock-Free stack in Ada SPARK
Date: Sat, 11 Feb 2017 23:40:15 +0100
Date: 2017-02-11T23:40:15+01:00	[thread overview]
Message-ID: <o7o3si$1dg6$1@gioia.aioe.org> (raw)
In-Reply-To: o7np0i$iu$1@dont-email.me

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

  parent reply	other threads:[~2017-02-11 22:40 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 [this message]
2017-02-11 23:02               ` stevenselectronicmail
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