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!newspeer1.nac.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!peer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post02.iad.highwinds-media.com!fx21.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> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <8qz9v.1037233$Va6.341076@fx21.iad> NNTP-Posting-Host: 68.145.219.148 X-Complaints-To: internet.abuse@sjrb.ca X-Trace: 1399243524 68.145.219.148 (Sun, 04 May 2014 22:45:24 UTC) NNTP-Posting-Date: Sun, 04 May 2014 22:45:24 UTC Date: Mon, 05 May 2014 16:46:26 -0600 X-Received-Bytes: 2051 X-Received-Body-CRC: 3013392268 X-Original-Bytes: 1969 Xref: number.nntp.dca.giganews.com comp.lang.ada:186230 Date: 2014-05-05T16:46:26-06:00 List-Id: On 04/05/2014 12:55 PM, Jeffrey Carter wrote: > If you're interested in a solution that is not GNAT-specific, the > skip-list implementation in the PragmAda Reusable Components has a > Search operation that is task safe. It's easy enough to use a skip list > as an ordered map. You'd have to use a[n] [Un]Bounded_String for the > key, but that shouldn't be too much of a problem. > > The PragmARCs are available from > > http://pragmada.x10hosting.com/pragmarc.htm > You might want to also have a look at the parallel red-black trees in the paraffinalia folders at http://sourceforge.net/projects/paraffin Once the tree is populated, I think querying the tree should be task safe, so long as no new nodes are added or deleted. It also provides parallel iteration through the tree, if needed. The tree was not otherwise intended to be task safe, but given the description of the OP's needs ( a constant container object ), it might be suitable.