Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

"Free markets select for winning solutions." -- Eric S. Raymond


devel / comp.lang.ada / Is a Boolean type inherently atomic ?

SubjectAuthor
* Is a Boolean type inherently atomic ?Rod Kay
+* Re: Is a Boolean type inherently atomic ?Jeffrey R.Carter
|`- Re: Is a Boolean type inherently atomic ?J-P. Rosen
+- Re: Is a Boolean type inherently atomic ?Niklas Holsti
+- Re: Is a Boolean type inherently atomic ?AdaMagica
`- Re: Is a Boolean type inherently atomic ?Rod Kay

1
Is a Boolean type inherently atomic ?

<u3lap0$1hvas$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=9613&group=comp.lang.ada#9613

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: rodakay5@gmail.com (Rod Kay)
Newsgroups: comp.lang.ada
Subject: Is a Boolean type inherently atomic ?
Date: Fri, 12 May 2023 22:17:48 +1000
Organization: A noiseless patient Spider
Lines: 6
Message-ID: <u3lap0$1hvas$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 12 May 2023 12:17:37 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="79596e872abf4f144f79f26c32851c2a";
logging-data="1637724"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/9zJfRHLBH23tJ6uYD6atlDXh4Bc8AJ/E="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.10.1
Cancel-Lock: sha1:s6NZ+jgbzDNo2Q0SPQLnZN1hoDA=
Content-Language: en-US
 by: Rod Kay - Fri, 12 May 2023 12:17 UTC

Surely only the least significant bit of the least significant byte
is relevant and so the value cannot be garbled by one task writing and
another reading at the same time ?

Regards.

Re: Is a Boolean type inherently atomic ?

<u3lcs5$1f7e7$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=9614&group=comp.lang.ada#9614

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: spam.jrcarter.not@spam.acm.org.not (Jeffrey R.Carter)
Newsgroups: comp.lang.ada
Subject: Re: Is a Boolean type inherently atomic ?
Date: Fri, 12 May 2023 14:53:24 +0200
Organization: A noiseless patient Spider
Lines: 14
Message-ID: <u3lcs5$1f7e7$1@dont-email.me>
References: <u3lap0$1hvas$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 12 May 2023 12:53:25 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="775151371d2c19a04e53995a45be44f4";
logging-data="1547719"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+E3MdKxEpeLs0YxvWcDYZb+VOf99xmNfQ="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.10.0
Cancel-Lock: sha1:sbaIY7jdwJ3KjG7eHfc2nZSj0JQ=
In-Reply-To: <u3lap0$1hvas$1@dont-email.me>
Content-Language: en-US
 by: Jeffrey R.Carter - Fri, 12 May 2023 12:53 UTC

On 2023-05-12 14:17, Rod Kay wrote:
>    Surely only the least significant bit of the least significant byte is
> relevant and so the value cannot be garbled by one task writing and another
> reading at the same time ?

Boolean types with other representations using multiple bits are possible, so
your assumption doesn't hold.

--
Jeff Carter
"Many times we're given rhymes that are quite unsingable."
Monty Python and the Holy Grail
57

Re: Is a Boolean type inherently atomic ?

<u3lr4m$1opm3$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=9615&group=comp.lang.ada#9615

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: rosen@adalog.fr (J-P. Rosen)
Newsgroups: comp.lang.ada
Subject: Re: Is a Boolean type inherently atomic ?
Date: Fri, 12 May 2023 18:56:54 +0200
Organization: Adalog
Lines: 22
Message-ID: <u3lr4m$1opm3$1@dont-email.me>
References: <u3lap0$1hvas$1@dont-email.me> <u3lcs5$1f7e7$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 12 May 2023 16:56:54 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="807060357abf6b605440910731b30894";
logging-data="1861315"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+ql7fKz+MY7be/PVAKxKaj"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.11.0
Cancel-Lock: sha1:ewXSS5LAx6IMnko5Xm/VjbtMqxY=
In-Reply-To: <u3lcs5$1f7e7$1@dont-email.me>
Content-Language: en-US, fr
 by: J-P. Rosen - Fri, 12 May 2023 16:56 UTC

Le 12/05/2023 à 14:53, Jeffrey R.Carter a écrit :
> On 2023-05-12 14:17, Rod Kay wrote:
>>     Surely only the least significant bit of the least significant
>> byte is relevant and so the value cannot be garbled by one task
>> writing and another reading at the same time ?
>
> Boolean types with other representations using multiple bits are
> possible, so your assumption doesn't hold.
>
True, especially considering the special exception for boolean types in
13.4(8)

Anyway, if you intend to access a variable from multiple tasks, it
doesn't cost much to add an aspect Atomic to the declaration, at least
to inform the reader!

--
J-P. Rosen
Adalog
2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX
https://www.adalog.fr https://www.adacontrol.fr

Re: Is a Boolean type inherently atomic ?

<kc7bslFq8heU1@mid.individual.net>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=9616&group=comp.lang.ada#9616

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: niklas.holsti@tidorum.invalid (Niklas Holsti)
Newsgroups: comp.lang.ada
Subject: Re: Is a Boolean type inherently atomic ?
Date: Fri, 12 May 2023 20:38:29 +0300
Organization: Tidorum Ltd
Lines: 18
Message-ID: <kc7bslFq8heU1@mid.individual.net>
References: <u3lap0$1hvas$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: individual.net v2NygZ34RZda/WCdk2dpKw0EYf9gUVKGnPsvVsMUgmSMZHitdI
Cancel-Lock: sha1:IncuqcJtbsVaJCKIfFcTX8XA5Wk=
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:102.0)
Gecko/20100101 Thunderbird/102.6.1
Content-Language: en-US
In-Reply-To: <u3lap0$1hvas$1@dont-email.me>
 by: Niklas Holsti - Fri, 12 May 2023 17:38 UTC

On 2023-05-12 15:17, Rod Kay wrote:
>    Surely only the least significant bit of the least significant byte
> is relevant and so the value cannot be garbled by one task writing and
> another reading at the same time ?

That seems very likely indeed, unless (as others have commented) the
representation has been specified to use more bits. However, the Ada RM
states in C.6(8/3) that "every atomic type or object is also defined to
be volatile", and of course Boolean variables are not considered
volatile unless they are specified to be Atomic or Volatile. So a
Boolean type is not inherently atomic in the Ada RM sense of "atomic".

And of course if you use a shared variable to communicate data between
tasks, that variable should be marked as Volatile, and there should also
be some Atomic accesses to ensure that actions are "sequential", so
marking the variable as Atomic is best.

Re: Is a Boolean type inherently atomic ?

<6c6a9722-6ccf-4148-a118-100bef22e65dn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=9618&group=comp.lang.ada#9618

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:a05:622a:506:b0:3ef:415f:189 with SMTP id l6-20020a05622a050600b003ef415f0189mr9389301qtx.6.1683914536342;
Fri, 12 May 2023 11:02:16 -0700 (PDT)
X-Received: by 2002:a5b:548:0:b0:ba6:f23c:d0cd with SMTP id
r8-20020a5b0548000000b00ba6f23cd0cdmr2219172ybp.2.1683914536202; Fri, 12 May
2023 11:02:16 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!feeder1.feed.usenet.farm!feed.usenet.farm!peer03.ams4!peer.am4.highwinds-media.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Fri, 12 May 2023 11:02:15 -0700 (PDT)
In-Reply-To: <u3lap0$1hvas$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=18.195.50.139; posting-account=rmHyLAoAAADSQmMWJF0a_815Fdd96RDf
NNTP-Posting-Host: 18.195.50.139
References: <u3lap0$1hvas$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <6c6a9722-6ccf-4148-a118-100bef22e65dn@googlegroups.com>
Subject: Re: Is a Boolean type inherently atomic ?
From: christ-usch.grein@t-online.de (AdaMagica)
Injection-Date: Fri, 12 May 2023 18:02:16 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1252
 by: AdaMagica - Fri, 12 May 2023 18:02 UTC

AARM 3.5.3(1.a), 13.4(8.b, 10/5) has some information about boolean representations.

Re: Is a Boolean type inherently atomic ?

<u3mlj9$1rofi$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=9621&group=comp.lang.ada#9621

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: rodakay5@gmail.com (Rod Kay)
Newsgroups: comp.lang.ada
Subject: Re: Is a Boolean type inherently atomic ?
Date: Sat, 13 May 2023 10:28:39 +1000
Organization: A noiseless patient Spider
Lines: 4
Message-ID: <u3mlj9$1rofi$1@dont-email.me>
References: <u3lap0$1hvas$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 13 May 2023 00:28:25 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="cc698777247115ebde7efe24ce071907";
logging-data="1958386"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18YeO6N5+l5Iy3BjKLjl4l1aXW+PBoRxNE="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.10.1
Cancel-Lock: sha1:6I71QrWvmlyVbfPXivn+Ai5exHk=
In-Reply-To: <u3lap0$1hvas$1@dont-email.me>
Content-Language: en-US
 by: Rod Kay - Sat, 13 May 2023 00:28 UTC

Okay, thank you all for the information.

Regards.

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor