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!feeder.eternal-september.org!gandalf.srv.welterde.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED.rrsoftware.com!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Task safe containers? Help needed. Date: Mon, 9 Oct 2017 16:54:13 -0500 Organization: JSA Research & Innovation Message-ID: References: Injection-Date: Mon, 9 Oct 2017 21:54:14 -0000 (UTC) Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226"; logging-data="13188"; mail-complaints-to="news@jacob-sparre.dk" X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Response X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246 Xref: news.eternal-september.org comp.lang.ada:48409 Date: 2017-10-09T16:54:13-05:00 List-Id: "Dmitry A. Kazakov" wrote in message news:orci8c$mpl$1@gioia.aioe.org... > On 2017-10-08 06:27, reinert wrote: > >> if I want to access a container (Vector, Set, Map) by several tasks >> (updating and reading) - (hopefully) without loosing functionality of >> the container. >> >> What should I do? > > 1. If operations are short and non-blocking put the container in a > protected object and route operations trough object's ones. If some of the operations are functions, and you have an up-to-date compiler, then use aspect Exclusive_Functions so that the mutual exclusion extends to the functions as well as the procedures in the protected object. Otherwise, functions aren't *officially* exclusive, so you have to use all procedures for proper exclusion. (Note: I'm not aware of any Ada compiler that actually allows non-exclusive functions, but the possibility exists unless you use the aspect.) Randy.