From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Task safe containers? Help needed.
Date: Mon, 9 Oct 2017 16:54:13 -0500
Date: 2017-10-09T16:54:13-05:00 [thread overview]
Message-ID: <orgr65$cs4$1@franka.jacob-sparre.dk> (raw)
In-Reply-To: orci8c$mpl$1@gioia.aioe.org
"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> 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.
next prev parent reply other threads:[~2017-10-09 21:54 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-08 4:27 Task safe containers? Help needed reinert
2017-10-08 5:42 ` Niklas Holsti
2017-10-08 6:57 ` Dmitry A. Kazakov
2017-10-08 15:10 ` reinert
2017-10-08 16:05 ` Dmitry A. Kazakov
2017-10-09 9:18 ` reinert
2017-10-09 21:54 ` Randy Brukardt [this message]
2017-10-10 7:25 ` Dmitry A. Kazakov
2017-10-10 19:48 ` Randy Brukardt
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox