From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-65-14.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-3.2 required=3.0 tests=BAYES_00,NICE_REPLY_A, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: "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 Message-ID: References: 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: Content-Language: en-US, fr Xref: news.eternal-september.org comp.lang.ada:65212 List-Id: 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