From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: border2.nntp.dca3.giganews.com!backlog4.nntp.dca3.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nac.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Natasha Kerensikova Newsgroups: comp.lang.ada Subject: Safety of unprotected concurrent operations on constant objects Date: Fri, 2 May 2014 08:42:56 +0000 (UTC) Organization: A noiseless patient Spider Message-ID: Injection-Date: Fri, 2 May 2014 08:42:56 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="76a49b86bc3e16725b7cfca3d85cb4c8"; logging-data="9288"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19NrBHNI3fXqHUDddR4wM6f" User-Agent: slrn/1.0.1 (FreeBSD) Cancel-Lock: sha1:bZt6pXLG6zuK0Dy5JljOH15mqR0= X-Original-Bytes: 1942 Xref: number.nntp.dca.giganews.com comp.lang.ada:186191 Date: 2014-05-02T08:42:56+00:00 List-Id: Hello, sorry to bother you again, but I got lost again in the RM looking for what I thought was a simple answer to a simple question: Is it safe to have many tasks performing operations concurrently on constant objects? The RM seems only to say things about operations on shared variables (e.g. in 9.10), which are understandably unsafe (but the guarantee of safe access to non-overlapping shared variables is a nice once). But what about concurrent private (presumably read) operations on constants? It seems obvious that there should be no harm in concurrent reading of memory, and therefore on concurrent operations on "simple" values, like scalars or untagged records. But are there any guarantee on the safety of hidden mechanisms, like tag checks or dispatching or the implementation of standard containers? Or could a conforming implementation use internally a splay tree and make it so that operations on objects declared constant, and indeed semantically constant, are task-unsafe? Thanks again for your help, Natasha