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: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Natasha Kerensikova Newsgroups: comp.lang.ada Subject: Re: Safety of unprotected concurrent operations on constant objects Date: Sun, 4 May 2014 15:57:02 +0000 (UTC) Organization: A noiseless patient Spider Message-ID: References: <7403d130-8b42-43cd-a0f1-53ba34b46141@googlegroups.com> <6c2cd5d4-a44c-4c18-81a3-a0e87d25cd9e@googlegroups.com> Injection-Date: Sun, 4 May 2014 15:57:02 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="76a49b86bc3e16725b7cfca3d85cb4c8"; logging-data="9223"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+HynV3cplfgmHkuqu/zj0v" User-Agent: slrn/1.0.1 (FreeBSD) Cancel-Lock: sha1:Jnr16UhcFHTR4DM07j2SzSFk/rI= Xref: news.eternal-september.org comp.lang.ada:19657 Date: 2014-05-04T15:57:02+00:00 List-Id: On 2014-05-04, sbelmont700@gmail.com wrote: > On Sunday, May 4, 2014 3:46:00 AM UTC-4, Natasha Kerensikova wrote: >> >> So I guess to correctly frame it as a question, that would be: how can I >> >> have a map capable of concurrent reads with minimal wheel reinvention? >> > > You really can't. You can either reinvent the wheel in your own > task-safe manner, I find it extremely hard to believe that there is no such wheel existing out there. Standard containers and Booch components might not fit the particular requirements, but I would bet there are some existing container implementations that fit. > or assume-the-worst about the standard map and surround it with a > mutex. Though, as was said, the split-seconds you would burn on the > mutex would be negligible when compared to the network delay of > supplying the results. How would you "surround it with a mutex"? Do you mean a procedure in a procted object, or some other scheme I'm not familiar with? However, if I start assuming the worst about standard containers, I might soon slip down the slope towards assuming the worst about all others standard features. There is nothing in the ARM that prevents tag checks or dispatching from being implemented through a splay tree or some other concurrent-read-unsafe mechanism, is there? Should I mutex those too then?