comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Task safe containers? Help needed.
Date: Sun, 8 Oct 2017 18:05:02 +0200
Date: 2017-10-08T18:05:02+02:00	[thread overview]
Message-ID: <ordibc$7ku$1@gioia.aioe.org> (raw)
In-Reply-To: e85dc912-3146-487c-aa02-a7e63f86375e@googlegroups.com

On 2017-10-08 17:10, reinert wrote:

> About your first option: Putting the containers in a protected
> object  makes the container functions "private" and not directly available
> outside the protected object. Right?

Which is good, since they are unsafe.

> But your other options also somehow complicates :-)

Not at all.

> A compromise seems to be necessary :-)

There is no compromise, each method has its use.

> Maybe the first option anyway
> facilitates cleanest code?

No. The cleanest code would be per delegation. Ada has none. Then there 
are issues with interface functions while most relevant synchronization 
mechanisms considered mutating. The Rosen's trick is used to work that 
around. A problem for monitor (#2.b) is to have an unconstrained result, 
since task entries cannot return such.

> There must be a reason for the invention of
> protected types.

The reason was to add an OO view on synchronization as a complement to 
the procedural view tasks offer.

The implementation provided by protected objects was chosen to be most 
efficient, powerful, safe, verifiable and universal. Which comes with 
certain limitations.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

  reply	other threads:[~2017-10-08 16:05 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 [this message]
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
replies disabled

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