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: border1.nntp.dca.giganews.com!nntp.giganews.com!goblin2!goblin.stu.neva.ru!reality.xs3.de!news.jacob-sparre.dk!loke.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Safety of unprotected concurrent operations on constant objects Date: Wed, 7 May 2014 22:45:35 -0500 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <7403d130-8b42-43cd-a0f1-53ba34b46141@googlegroups.com> <1jbqe7sd9d13f.1p91l6pdkv6fz.dlg@40tude.net> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: loke.gir.dk 1399520736 6349 69.95.181.76 (8 May 2014 03:45:36 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Thu, 8 May 2014 03:45:36 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Date: 2014-05-07T22:45:35-05:00 List-Id: "Dmitry A. Kazakov" wrote in message news:1jbqe7sd9d13f.1p91l6pdkv6fz.dlg@40tude.net... > On Sun, 04 May 2014 14:25:26 -0600, Shark8 wrote: > >> On 04-May-14 01:46, Natasha Kerensikova wrote: >>> I have some shared resources indexed by a string, described in a >>> file, and considered as constant throughout the lifetime of the program >>> (with the standard scheme "restart for changes to take effect"). >> >> What's the problem, then, with making the entire map constant? > > That is not enough. Technically speaking all operations must be reentrant. > All arguments being immutable does not make a subprogram reentrant. Right. And "constant" doesn't have that effect (of immutability) for private types anyway. It just prevents assigning to the whole object *from the current view*. But it's easy to get a variable view for immutably limited types, and not hard for controlled types. Not to mention access-to-variable components. And you cannot assume that there aren't any controlled components or access-to-variable components for a private type. Randy.