comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Task safe containers? Help needed.
Date: Tue, 10 Oct 2017 14:48:35 -0500
Date: 2017-10-10T14:48:35-05:00	[thread overview]
Message-ID: <orj86j$rmt$1@franka.jacob-sparre.dk> (raw)
In-Reply-To: orhslu$pji$1@gioia.aioe.org

"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message 
news:orhslu$pji$1@gioia.aioe.org...
> On 09/10/2017 23:54, Randy Brukardt wrote:
>
>> 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.
>
> Interesting.
>
> BTW, if protected types were declared as a normal types without ugly 
> C++-ish brackets, then we could simply have it passed in-out mode. 
> Functions are now allowed to have this. Or it could be passed as a 
> non-constant anonymous access. Both would naturally imply 
> "update-exclusion", no aspect ever needed.

I agree that the function/procedure definition was a bad idea: only 2 of the 
4 possibilities are supported, and all of the can make sense. Too late to 
fix, though.

Also note that you might need exclusion for read-only access (that's 
definitely true in Ada 2005/2012 where there are no guarantee of task safety 
even for reading of a container -- Ada 2020 will change this slightly).

                               Randy.



      reply	other threads:[~2017-10-10 19:48 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
2017-10-10  7:25     ` Dmitry A. Kazakov
2017-10-10 19:48       ` Randy Brukardt [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox