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.dca3.giganews.com!backlog3.nntp.dca3.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!peer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post02.iad.highwinds-media.com!fx05.iad.POSTED!not-for-mail From: Brad Moore User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Safety of unprotected concurrent operations on constant objects References: <7403d130-8b42-43cd-a0f1-53ba34b46141@googlegroups.com> <6c2cd5d4-a44c-4c18-81a3-a0e87d25cd9e@googlegroups.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: NNTP-Posting-Host: 68.145.219.148 X-Complaints-To: internet.abuse@sjrb.ca X-Trace: 1399238552 68.145.219.148 (Sun, 04 May 2014 21:22:32 UTC) NNTP-Posting-Date: Sun, 04 May 2014 21:22:32 UTC Date: Mon, 05 May 2014 15:23:33 -0600 X-Received-Bytes: 2346 X-Received-Body-CRC: 3138057492 X-Original-Bytes: 2588 Xref: number.nntp.dca.giganews.com comp.lang.ada:186223 Date: 2014-05-05T15:23:33-06:00 List-Id: On 05/05/2014 1:04 PM, Brad Moore wrote: > On 04/05/2014 9:57 AM, Natasha Kerensikova wrote: >> 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. > > I believe as long as the use of the container involves only read > operations (functions with in parameters), it should be safe to use > concurrently. I need to correct myself. In GNAT any read or write operations on a container that set tamper flags are ironically not task safe, so that does restrict quite a bit what one can do concurrently.